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
- WP_Customize_Control::active()Checks whether control is active to current Customizer preview.
- WP_Customize_Control::get_content()Gets the control's content for insertion into the Customizer pane.
Used by · 7
- WP_Customize_Color_Control::to_json()Refresh the parameters passed to the JavaScript via JSON.
- WP_Customize_Control::json()Gets the data to export to the client via JSON.
- WP_Customize_Media_Control::to_json()Refresh the parameters passed to the JavaScript via JSON.
- WP_Customize_Nav_Menu_Location_Control::to_json()Refresh the parameters passed to JavaScript via JSON.
- WP_Customize_Theme_Control::to_json()Refresh the parameters passed to the JavaScript via JSON.
- WP_Widget_Area_Customize_Control::to_json()Refreshes the parameters passed to the JavaScript via JSON.
- WP_Widget_Form_Customize_Control::to_json()Gather control params for exporting to JavaScript.
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.
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.