WP_Customize_Section::__construct( WP_Customize_Manager $manager, string $id, array $args = array() )
Constructor.
Description
Any supplied $args override class property defaults.
Parameters
- $manager
-
(Required) Customizer bootstrap instance.
- $id
-
(Required) A specific ID of the section.
- $args
-
(Optional) Array of properties for the new Section object. <br>
- 'priority'
(int) Priority of the section, defining the display order of panels and sections. Default 160.<br> - 'panel'
(string) The panel this section belongs to (if any).<br> <br> - 'capability'
(string) Capability required for the section.<br> Default 'edit_theme_options' - 'theme_supports'
(string|string[]) Theme features required to support the section.<br> - 'title'
(string) Title of the section to show in UI.<br> - 'description'
(string) Description to show in the UI.<br> - 'type'
(string) Type of the section.<br> - 'active_callback'
(callable) Active callback.<br> - 'description_hidden'
(bool) Hide the description behind a help icon, instead of inline above the first control.<br> Default false.<br>
Default value: array()
- 'priority'
Source
File: wp-includes/class-wp-customize-section.php
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.
}
Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |