wppaste
WordPress

WP_Customize_Panel

Since
4.0.0
Source
wp-includes/class-wp-customize-panel.php:24
Customize Panel class.

Description

A UI container for sections, managed by the WP_Customize_Manager.

Compatibility

WordPress
since 4.0.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 · 3

Every hook that fires from inside WP_Customize_Panel, in the order it appears in the class, grouped by the method that fires it.

Properties · 13

$instance_countintprotected static
Incremented with each new class instantiation, then stored in $instance_number.
$instance_numberintpublic
Order in which this instance was created in relation to other instances.
$managerWP_Customize_Managerpublic
WP_Customize_Manager instance.
$idstringpublic
Unique identifier.
$priorityintpublic
Priority of the panel, defining the display order of panels and sections.
$capabilitystringpublic
Capability required for the panel.
$theme_supportsmixed[]public
Theme features required to support the panel.
$titlestringpublic
Title of the panel to show in UI.
$descriptionstringpublic
Description to show in the UI.
$auto_expand_sole_sectionboolpublic
Auto-expand a section in a panel when the panel is expanded when the panel only has the one section.
$sectionsarraypublic
Customizer sections for this panel.
$typestringpublic
Type of this panel.
$active_callbackcallablepublic
Active callback.

Methods · 12

  • __construct()Constructor.
  • active()Check whether panel is active to current Customizer preview.
  • active_callback()Default callback used when invoking WP_Customize_Panel::active().
  • json()Gather the parameters passed to client JavaScript via JSON.
  • check_capabilities()Checks required user capabilities and whether the theme has the feature support required by the panel.
  • get_content()Get the panel's content template for insertion into the Customizer pane.
  • maybe_render()Check capabilities and render the panel.
  • render()Render the panel container, and then its contents (via `this->render_content()`) in a subclass.
  • render_content()Render the panel UI in a subclass.
  • print_template()Render the panel's JS templates.
  • render_template()An Underscore (JS) template for rendering this panel's container.
  • content_template()An Underscore (JS) template for this panel's content (but not its container).

Source code

#[AllowDynamicProperties]class WP_Customize_Panel { 	/**	 * Incremented with each new class instantiation, then stored in $instance_number.	 *	 * Used when sorting two instances whose priorities are equal.	 *	 * @since 4.1.0	 * @var int	 */	protected static $instance_count = 0; 	/**	 * Order in which this instance was created in relation to other instances.	 *	 * @since 4.1.0	 * @var int	 */	public $instance_number; 	/**	 * WP_Customize_Manager instance.	 *	 * @since 4.0.0	 * @var WP_Customize_Manager	 */	public $manager; 	/**	 * Unique identifier.	 *	 * @since 4.0.0	 * @var string	 */	public $id; 	/**	 * Priority of the panel, defining the display order of panels and sections.	 *	 * @since 4.0.0	 * @var int	 */	public $priority = 160; 	/**	 * Capability required for the panel.	 *	 * @since 4.0.0	 * @var string	 */	public $capability = 'edit_theme_options'; 	/**	 * Theme features required to support the panel.	 *	 * @since 4.0.0	 * @var mixed[]	 */	public $theme_supports = ''; 	/**	 * Title of the panel to show in UI.	 *	 * @since 4.0.0	 * @var string	 */	public $title = ''; 	/**	 * Description to show in the UI.	 *	 * @since 4.0.0	 * @var string	 */	public $description = ''; 	/**	 * Auto-expand a section in a panel when the panel is expanded when the panel only has the one section.	 *

Changelog

Introduced in 4.0.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 6.8.8 tag, from src/wp-includes/class-wp-customize-panel.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.