Supplied $args override class property defaults. If $args['settings'] is not defined, use the $id as the setting ID.
Parameters
$managerWP_Customize_Manager
Customizer bootstrap instance.
$idstring
Control ID.
$argsarrayoptional
Array of properties for the new Control object. Default empty array.Default: array()
$instance_numberint
Order in which this instance was created in relation to other instances.
$managerWP_Customize_Manager
Customizer bootstrap instance.
$idstring
Control ID.
$settingsarray
All settings tied to the control. If undefined, $id will be used.
$settingstringdefault: 'default'
The primary setting for the control (if there is one).
$capabilitystring
Capability required to use this control. Normally this is empty and the capability is derived from $settings.
$priorityintdefault: 10
Order priority to load the control.
$sectionstringdefault: empty
Section the control belongs to.
$labelstringdefault: empty
Label for the control.
$descriptionstringdefault: empty
Description for the control.
$choicesarraydefault: empty array
List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values.
$input_attrsarraydefault: empty array
List of custom input attributes for control output, where attribute names are the keys and values are the values. Not used for 'checkbox', 'radio', 'select', or 'dropdown-pages' control types.
$allow_additionbooldefault: false
Show UI for adding new content, currently only used for the dropdown-pages control.
$jsonarray
Deprecated. Use WP_Customize_Control::json() instead.
$typestringdefault: 'text'
Control type. Core controls include 'text', 'checkbox', 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional input types such as 'email', 'url', 'number', 'hidden', and 'date' are supported implicitly.
216publicfunction__construct($manager,$id,$args=array()){217$keys=array_keys(get_object_vars($this));218foreach($keysas$key){219if(isset($args[$key])){220$this->$key=$args[$key];221}222}223224$this->manager=$manager;225$this->id=$id;226if(empty($this->active_callback)){227$this->active_callback=array($this,'active_callback');228}229self::$instance_count+=1;230$this->instance_number=self::$instance_count;231232// Process settings.233if(!isset($this->settings)){234$this->settings=$id;235}236237$settings=array();238if(is_array($this->settings)){239foreach($this->settingsas$key=>$setting){240$settings[$key]=$this->manager->get_setting($setting);241}242}elseif(is_string($this->settings)){243$this->setting=$this->manager->get_setting($this->settings);244$settings['default']=$this->setting;245}246$this->settings=$settings;247}
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 6.9.7 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.