wppaste
WordPress

WP_Customize_Control::to_json()

Since
3.4.0
Source
wp-includes/class-wp-customize-control.php:314
Refreshes the parameters passed to the JavaScript via JSON.

Uses · 2

Used by · 7

Source

	public function to_json() {		$this->json['settings'] = array();		foreach ( $this->settings as $key => $setting ) {			$this->json['settings'][ $key ] = $setting->id;		} 		$this->json['type']           = $this->type;		$this->json['priority']       = $this->priority;		$this->json['active']         = $this->active();		$this->json['section']        = $this->section;		$this->json['content']        = $this->get_content();		$this->json['label']          = $this->label;		$this->json['description']    = $this->description;		$this->json['instanceNumber'] = $this->instance_number; 		if ( 'dropdown-pages' === $this->type ) {			$this->json['allow_addition'] = $this->allow_addition;		}	}

History

Introduced in 3.4.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/class-wp-customize-control.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.