Created
May 6, 2015 18:05
-
-
Save wpmark/06937f9baca8d80a1add to your computer and use it in GitHub Desktop.
Register Shortcode with Shortcode UI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* function wpmark_register_before_after_shortcake() | |
*/ | |
function wpmark_register_before_after_shortcake() { | |
shortcode_ui_register_for_shortcode( | |
'before_after_image', // name of shortcode ui | |
array( | |
'label' => 'Before After Image', | |
'listItemImage' => 'dashicons-format-image', | |
'attrs' => array( | |
array( | |
'label' => 'Title', | |
'attr' => 'title', | |
'type' => 'text', | |
'description' => 'Enter a title for this before/after image', | |
), | |
array( | |
'label' => 'Before Image', | |
'attr' => 'before_image', | |
'type' => 'attachment', | |
'description' => 'Choose/Upload an image for the before image. This should be at least 634px wide and the same size as the after image.', | |
), | |
array( | |
'label' => 'After Image', | |
'attr' => 'after_image', | |
'type' => 'attachment', | |
'description' => 'Choose/Upload an image for the after image. This should be at least 634px wide and the same size as the before image.', | |
), | |
array( | |
'label' => 'Description', | |
'attr' => 'description', | |
'type' => 'textarea', | |
'description' => 'Enter a description for this before/after image', | |
), | |
), | |
) | |
); | |
} | |
add_action( 'init', 'wpmark_register_before_after_shortcake' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment