Register UI code
-
I am sorry, but it is not obvious how to register UI code.
Where should i add this? Maybe you can add a ‘dummy’ description:)
-
I am sorry, but it is not obvious how to register UI code.
Please take a look at the documentation in the wiki: https://github.com/fusioneng/Shortcake/wiki/Registering-Shortcode-UI
Where should i add this?
Your theme’s
functions.php
file would be a good place.Thank you for your quick reply!!
I added the following to functions.php:
/** * Register a UI for the Shortcode. * Pass the shortcode tag (string) * and an array or args. */ shortcode_ui_register_for_shortcode( 'shortcake_dev', array( // Display label. String. Required. 'label' => 'Shortcake Dev', // Icon/attachment for shortcode. Optional. src or dashicons-$icon. Defaults to carrot. 'listItemImage' => 'dashicons-editor-quote', 'inner_content' => array( 'label' => 'Quote', ), 'post_type' => array( 'post' ), // Available shortcode attributes and default values. Required. Array. // Attribute model expects 'attr', 'type' and 'label' // Supported field types: text, checkbox, textarea, radio, select, email, url, number, and date. 'attrs' => array( array( 'label' => 'Attachment', 'attr' => 'attachment', 'type' => 'attachment', 'libraryType' => array( 'image' ), 'addButton' => 'Select Image', 'frameTitle' => 'Select Image', ), array( 'label' => 'Cite', 'attr' => 'source', 'type' => 'text', 'meta' => array( 'placeholder' => 'Test placeholder', 'data-test' => 1, ), ), array( 'label' => 'Select Page', 'attr' => 'page', 'type' => 'post_select', 'query' => array( 'post_type' => 'page' ), 'multiple' => true, ), ), ) ); /** * Register a UI for the Shortcode. * Pass the shortcode tag (string) * and an array or args. */ shortcode_ui_register_for_shortcode( 'shortcake_dev', array( // Display label. String. Required. 'label' => 'Shortcake Dev', // Icon/attachment for shortcode. Optional. src or dashicons-$icon. Defaults to carrot. 'listItemImage' => 'dashicons-editor-quote', 'inner_content' => array( 'label' => 'Quote', ), 'post_type' => array( 'post' ), // Available shortcode attributes and default values. Required. Array. // Attribute model expects 'attr', 'type' and 'label' // Supported field types: text, checkbox, textarea, radio, select, email, url, number, and date. 'attrs' => array( array( 'label' => 'Attachment', 'attr' => 'attachment', 'type' => 'attachment', 'libraryType' => array( 'image' ), 'addButton' => 'Select Image', 'frameTitle' => 'Select Image', ), array( 'label' => 'Cite', 'attr' => 'source', 'type' => 'text', 'meta' => array( 'placeholder' => 'Test placeholder', 'data-test' => 1, ), ), array( 'label' => 'Select Page', 'attr' => 'page', 'type' => 'post_select', 'query' => array( 'post_type' => 'page' ), 'multiple' => true, ), ), ) );
Can you help me further?
I am a web designer / web developer, not that technical..This is a really nice plugin, i can see it’s potential!
but I am sorry, i really can’t get it to work…Is there some kind of video tutorial or step-by-step tutorial?
This should be in WP Core i think!!I did the very same and I am having no luck either. I don’t consider myself stupid, but this is either a very complicated installation or the most under-documented plugin installation I have ever encountered. Maybe both, but I am still hoping to be able to use it as I have used it with themes that have the compatibility built-in, and I love it!
I tried to activate the plugin and received an error – Parse error: syntax error, unexpected T_FUNCTION in /home/content/M/y/i/Myiscom/html/portstlucie/wp-content/plugins/shortcode-ui/shortcode-ui.php on line 32.
Do you put everything on that page into function.php or only selected parts?
This lack of documentation is hopeless. And I don’t even know if it’s going to do what I want.
I want to hide everything in the visual editor but the year link in this rather long set of shortcodes:
[popup id=”table”][table id=65 /][/popup]
[popup_trigger id=”table”]2014[/popup_trigger]
- The topic ‘Register UI code’ is closed to new replies.