Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Admin_Shortcode_UI::shortcode_ui_var()

Generates a json object variable to pass to the Shortcode UI front end.


Description Description


Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Return Return

(array)


Top ↑

Source Source

File: classes/Admin/Shortcode/UI.php

	public static function shortcode_ui_var() {
		$type = pum_typenow();

		$shortcodes = array();

		foreach ( PUM_Shortcodes::instance()->get_shortcodes() as $tag => $shortcode ) {

			$post_types = apply_filters( 'pum_shortcode_post_types', $shortcode->post_types(), $shortcode );

			/**
			 * @var $shortcode PUM_Shortcode
			 */
			if ( ! in_array( '*', $post_types ) && ! in_array( $type, $post_types ) ) {
				continue;
			}

			$shortcodes[ $tag ] = array(
				'version'        => $shortcode->version,
				'label'          => $shortcode->label(),
				'description'    => $shortcode->description(),
				'tabs'           => $shortcode->_tabs(),
				'sections'        => $shortcode->_subtabs(),
				'fields'         => $shortcode->_fields(),
				'has_content'    => $shortcode->has_content,
				'ajax_rendering' => $shortcode->ajax_rendering === true,
			);
		}

		return $shortcodes;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.