WP_Customize_Panel::json() WordPress Method

The WP_Customize_Panel::json() method allows you to retrieve the JSON representation of a Customize panel. This is useful for making changes to a panel via the Wordpress Customizer API.

WP_Customize_Panel::json() #

Gather the parameters passed to client JavaScript via JSON.


Return

(array) The array to be exported to the client as JSON.


Top ↑

Source

File: wp-includes/class-wp-customize-panel.php

	public function json() {
		$array                          = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'type' ) );
		$array['title']                 = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
		$array['content']               = $this->get_content();
		$array['active']                = $this->active();
		$array['instanceNumber']        = $this->instance_number;
		$array['autoExpandSoleSection'] = $this->auto_expand_sole_section;
		return $array;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.