Supplied $args override class property defaults. If $args['settings'] is not defined, use the $id as the setting ID.
Parameters
$componentWP_Customize_Selective_Refresh
Customize Partial Refresh plugin instance.
$idstring
Control ID.
$argsarrayoptional
Array of properties for the new Partials object. Default empty array.Default: array()
$typestring
Type of the partial to be created.
$selectorstring
The jQuery selector to find the container element for the partial, that is, a partial's placement.
$settingsstring[]
IDs for settings tied to the partial. If undefined, $id will be used.
$primary_settingstring
The ID for the setting that this partial is primarily responsible for rendering. If not supplied, it will default to the ID of the first setting.
$capabilitystring
Capability required to edit this partial. Normally this is empty and the capability is derived from the capabilities of the associated $settings.
$render_callbackcallable
Render callback. Callback is called with one argument, the instance of WP_Customize_Partial. The callback can either echo the partial or return the partial as a string, or return false if error.
$container_inclusivebool
Whether the container element is included in the partial, or if only the contents are rendered.
$fallback_refreshbool
Whether to refresh the entire preview in case a partial cannot be refreshed. A partial render is considered a failure if the render_callback returns false.
161publicfunction__construct(WP_Customize_Selective_Refresh$component,$id,$args=array()){162$keys=array_keys(get_object_vars($this));163foreach($keysas$key){164if(isset($args[$key])){165$this->$key=$args[$key];166}167}168169$this->component=$component;170$this->id=$id;171$this->id_data['keys']=preg_split('/\[/',str_replace(']','',$this->id));172$this->id_data['base']=array_shift($this->id_data['keys']);173174if(empty($this->render_callback)){175$this->render_callback=array($this,'render_callback');176}177178// Process settings.179if(!isset($this->settings)){180$this->settings=array($id);181}elseif(is_string($this->settings)){182$this->settings=array($this->settings);183}184185if(empty($this->primary_setting)){186$this->primary_setting=current($this->settings);187}188}
History
Introduced in 4.5.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.0.4 tag, from src/wp-includes/customize/class-wp-customize-partial.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.