Title: Register UI code
Last modified: August 30, 2016

---

# Register UI code

 *  Resolved [mschouten](https://wordpress.org/support/users/mschouten/)
 * (@mschouten)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/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:)
 * [https://wordpress.org/plugins/shortcode-ui/](https://wordpress.org/plugins/shortcode-ui/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/register-ui-code/#post-6425870)
 * > 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](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.
 *  Thread Starter [mschouten](https://wordpress.org/support/users/mschouten/)
 * (@mschouten)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/register-ui-code/#post-6425884)
 * 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..
 *  Thread Starter [mschouten](https://wordpress.org/support/users/mschouten/)
 * (@mschouten)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/register-ui-code/#post-6426054)
 * This is a really nice plugin, i can see it’s potential!
    but I am sorry, i really
   can’t get it to work…
 *  Thread Starter [mschouten](https://wordpress.org/support/users/mschouten/)
 * (@mschouten)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/register-ui-code/#post-6426069)
 * Is there some kind of video tutorial or step-by-step tutorial?
    This should be
   in WP Core i think!!
 *  [Just Dave](https://wordpress.org/support/users/just-dave/)
 * (@just-dave)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/register-ui-code/#post-6426071)
 * 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!
 *  [Isabella Scott](https://wordpress.org/support/users/isabella-scott/)
 * (@isabella-scott)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/register-ui-code/#post-6426072)
 * 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.
 *  [digbymaass](https://wordpress.org/support/users/digbymaass/)
 * (@digbymaass)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/register-ui-code/#post-6426091)
 * 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](https://wordpress.org/support/topic/register-ui-code/?output_format=md#)[/
   popup_trigger]

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Register UI code’ is closed to new replies.

 * ![](https://ps.w.org/shortcode-ui/assets/icon.svg?rev=1130575)
 * [Shortcake (Shortcode UI)](https://wordpress.org/plugins/shortcode-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-ui/reviews/)

 * 7 replies
 * 5 participants
 * Last reply from: [digbymaass](https://wordpress.org/support/users/digbymaass/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/register-ui-code/#post-6426091)
 * Status: resolved