wppaste
WordPress

WP_Customize_Section

Since
3.4.0
Source
wp-includes/class-wp-customize-section.php:19
Customize Section class.

Description

A UI container for controls, managed by the WP_Customize_Manager class.

Compatibility

WordPress
since 3.4.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_Section, in the order it appears in the class, grouped by the method that fires it.

Properties · 14

$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 section which informs load order of sections.
$panelstringpublic
Panel in which to show the section, making it a sub-section.
$capabilitystringpublic
Capability required for the section.
$theme_supportsstring|string[]public
Theme features required to support the section.
$titlestringpublic
Title of the section to show in UI.
$descriptionstringpublic
Description to show in the UI.
$controlsarraypublic
Customizer controls for this section.
$typestringpublic
Type of this section.
$active_callbackcallablepublic
Active callback.
$description_hiddenboolpublic
Show the description or hide it behind the help icon.

Methods · 10

  • __construct()Constructor.
  • active()Check whether section is active to current Customizer preview.
  • active_callback()Default callback used when invoking WP_Customize_Section::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 section.
  • get_content()Get the section's content for insertion into the Customizer pane.
  • maybe_render()Check capabilities and render the section.
  • render()Render the section UI in a subclass.
  • print_template()Render the section's JS template.
  • render_template()An Underscore (JS) template for rendering this section.

Source code

#[AllowDynamicProperties]class WP_Customize_Section { 	/**	 * 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 3.4.0	 * @var WP_Customize_Manager	 */	public $manager; 	/**	 * Unique identifier.	 *	 * @since 3.4.0	 * @var string	 */	public $id; 	/**	 * Priority of the section which informs load order of sections.	 *	 * @since 3.4.0	 * @var int	 */	public $priority = 160; 	/**	 * Panel in which to show the section, making it a sub-section.	 *	 * @since 4.0.0	 * @var string	 */	public $panel = ''; 	/**	 * Capability required for the section.	 *	 * @since 3.4.0	 * @var string	 */	public $capability = 'edit_theme_options'; 	/**	 * Theme features required to support the section.	 *	 * @since 3.4.0	 * @var string|string[]	 */	public $theme_supports = ''; 	/**	 * Title of the section to show in UI.	 *	 * @since 3.4.0	 * @var string	 */	public $title = ''; 	/**	 * Description to show in the UI.	 *

Changelog

Introduced in 3.4.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 7.0.4 tag, from src/wp-includes/class-wp-customize-section.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.