On this page
WP_Customize_Section::__construct( WP_Customize_Manager $manager, string $id, array $args = array() )
Constructor.
Description
Any supplied $args override class property defaults.
Parameters
$managerWP_Customize_Manager Required-
Customizer bootstrap instance.
$idstring Required-
A specific ID of the section.
$argsarray Optional-
Array of properties for the new Section object.
priorityintPriority of the section, defining the display order of panels and sections. Default 160.panelstringThe panel this section belongs to (if any).
capabilitystringCapability required for the section.
Default'edit_theme_options'theme_supportsstring|string[]Theme features required to support the section.titlestringTitle of the section to show in UI.descriptionstringDescription to show in the UI.typestringType of the section.active_callbackcallableActive callback.description_hiddenboolHide the description behind a help icon, instead of inline above the first control.
Default false.
Default:
array()
Source
File: wp-includes/class-wp-customize-section.php. View all references
public function __construct( $manager, $id, $args = array() ) {
$keys = array_keys( get_object_vars( $this ) );
foreach ( $keys as $key ) {
if ( isset( $args[ $key ] ) ) {
$this->$key = $args[ $key ];
}
}
$this->manager = $manager;
$this->id = $id;
if ( empty( $this->active_callback ) ) {
$this->active_callback = array( $this, 'active_callback' );
}
self::$instance_count += 1;
$this->instance_number = self::$instance_count;
$this->controls = array(); // Users cannot customize the $controls array.
}
Related
Used By
| Used By | Description |
|---|---|
| WP_Customize_New_Menu_Section::__construct() wp-includes/customize/class-wp-customize-new-menu-section.php | Constructor. |
| WP_Customize_Manager::add_section() wp-includes/class-wp-customize-manager.php | Adds a customize section. |
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/WP_Customize_Section/__construct