WP_Customize_Partial
- Since
- 4.5.0
- Source
wp-includes/customize/class-wp-customize-partial.php:19
Core Customizer class for implementing selective refresh partials.
Description
Representation of a rendered region in the previewed page that gets selectively refreshed when an associated setting is changed.
This class is analogous of WP_Customize_Control.
Compatibility
- WordPress
- since 4.5.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 2
Every hook that fires from inside WP_Customize_Partial, in the order it appears in the class, grouped by the method that fires it.
Properties · 11
$componentWP_Customize_Selective_Refreshpublic- Component.
$idstringpublic- Unique identifier for the partial.
$id_dataarrayprotected- Parsed ID.
$typestringpublic- Type of this partial.
$selectorstringpublic- The jQuery selector to find the container element for the partial.
$settingsstring[]public- IDs for settings tied to the partial.
$primary_settingstringpublic- The ID for the setting that this partial is primarily responsible for rendering.
$capabilitystringpublic- Capability required to edit this partial.
$render_callbackcallablepublic- Render callback.
$container_inclusiveboolpublic- Whether the container element is included in the partial, or if only the contents are rendered.
$fallback_refreshboolpublic- Whether to refresh the entire preview in case a partial cannot be refreshed.
Methods · 6
- __construct()Constructor.
- id_data()Retrieves parsed ID data for multidimensional setting.
- render()Renders the template partial involving the associated settings.
- render_callback()Default callback used when invoking WP_Customize_Control::render().
- json()Retrieves the data to export to the client via JSON.
- check_capabilities()Checks if the user can refresh this partial.
Source code
#[AllowDynamicProperties]class WP_Customize_Partial { /** * Component. * * @since 4.5.0 * @var WP_Customize_Selective_Refresh */ public $component; /** * Unique identifier for the partial. * * If the partial is used to display a single setting, this would generally * be the same as the associated setting's ID. * * @since 4.5.0 * @var string */ public $id; /** * Parsed ID. * * @since 4.5.0 * @var array { * @type string $base ID base. * @type array $keys Keys for multidimensional. * } */ protected $id_data = array(); /** * Type of this partial. * * @since 4.5.0 * @var string */ public $type = 'default'; /** * The jQuery selector to find the container element for the partial. * * @since 4.5.0 * @var string */ public $selector; /** * IDs for settings tied to the partial. * * @since 4.5.0 * @var string[] */ public $settings; /** * 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. * * @since 4.5.0 * @var string */ public $primary_setting; /** * Capability required to edit this partial. * * Normally this is empty and the capability is derived from the capabilities * of the associated `$settings`. * * @since 4.5.0 * @var string */ public $capability; /** * Render callback.Changelog
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.1.0 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.