![]() ![]() 'description' => 'Insert the category full name (i.e. 'options' =>$feat_pages_terms/*$multiarr*/, $multiarr = array('value' => $feat_page_term->name, 'label' => $feat_page_term->name) $feat_pages_terms = array('value' => $feat_page_term->name, 'label' => $feat_page_term->name) ![]() function shortcode_ui_feat_pages()įoreach($feat_pages_terms as $key => $feat_page_term) : When using this option, $key is not needed as new elements are simply being appended. I have reused the $feat_pages_terms variable, but you can also create a separate variable using array() and assign array elements to that, I am including those lines as commented lines. The multidimensional array is created by assigning an array to each element of the main array. This creates the multidimensional array in advance and then assigns it to options. It just doesn't like me declaration to get_terms() when making the variable $feat_pages_terms.ĭo I have to run this logic outside the shortcode ui registration and explode the values into it later? Introduced a registershortcodeui hook for plugins to more safely register UI with. I'm just a bit stuck getting it to populate the options for select from the custom post type taxonomy 'featured_page_category'. 30 2.2k Pedja Rusic Pro 20 1.6k Suvdaa 5 2k Uranbold Nergui 10 1.3k The IconBlock Ltd. I have tested the foreach loop outside the code which registers the featured-pages array and it outputs fine. 10 unique iconbox designs, illustrations, and graphic elements Popular Discover Animation Branding Illustration Mobile Print Product Design Typography Web Design Filters Timo Eising 13 1k ly 32 785 Juan Gomez 129 3.8k Wil Nichols Pro 18 648 The IconBlock Ltd. ![]() 'description' => 'You can order the pages in ascending or descending order (A-Z or Z-A)', 'description' => 'Choose how you want to order the Featured Pages',Īrray('value' => 'ASC', 'label' => esc_html_('Ascending')),Īrray('value' => 'DESC', 'label' => esc_html_('Descending')), $feat_pages_terms = get_terms(array('taxonomy' => 'featured_page_category', 'hide_empty' => false)) įoreach($feat_pages_terms as $feat_page_term) :Įcho 'array(\'value\' =>\''. 'listItemImage' => 'dashicons-editor-table', Here is the code: // Register the Featured Pages shortcode with 'Shortcake UI' pluginĪdd_action( 'register_shortcode_ui', 'shortcode_ui_feat_pages' ) Right now I am getting a parse error as such: Parse error: syntax error, unexpected ' ', expecting ')' in. I am trying to grab all the taxonomy terms (via get_terms()) and then populating arrays for the interface. * Enqueue scripts and styles needed for shortcode UI.I am using the shortcake UI plugin and working towards registering a series of shortcodes into the UI interface. If ( ! get_option( 'shortcode_ui_activation_notice' ) ). * If there are already plugins with UI registered, will just display a success message. * If no shortcodes with Shortcake UI are registered, this Will display a link to the plugin's wiki for examples. $ this-> plugin_url = plugin_dir_url( dirname( _FILE_ ) ) Īdd_action( 'admin_notices', array( $ this, 'action_admin_notices' ) ) Īdd_action( 'admin_enqueue_scripts', array( $ this, 'action_admin_enqueue_scripts' ) ) Īdd_action( 'wp_enqueue_editor', array( $ this, 'action_wp_enqueue_editor' ) ) Īdd_action( 'media_buttons', array( $ this, 'action_media_buttons' ) ) Īdd_action( 'wp_ajax_bulk_do_shortcode', array( $ this, 'handle_ajax_bulk_do_shortcode' ) ) Īdd_filter( 'wp_editor_settings', array( $ this, 'filter_wp_editor_settings' ), 10, 2 ) $ this-> plugin_dir = plugin_dir_path( dirname( _FILE_ ) ) $ this-> plugin_version = SHORTCODE_UI_VERSION * Set up instance attributes when initially loaded. ![]()
0 Comments
Leave a Reply. |