Used By
Used By | Description |
---|---|
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::add_panel() | Add a customize panel. |
Constructor.
Any supplied $args override class property defaults.
(WP_Customize_Manager) (Required) Customizer bootstrap instance.
(string) (Required) A specific ID for the panel.
(array) (Optional) Array of properties for the new Panel object.
(int) Priority of the panel, defining the display order of panels and sections. Default 160.
(string) Capability required for the panel. Default edit_theme_options
.
(string|string[]) Theme features required to support the panel.
(string) Title of the panel to show in UI.
(string) Description to show in the UI.
(string) Type of the panel.
(callable) Active callback.
Default value: array()
File: wp-includes/class-wp-customize-panel.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->sections = array(); // Users cannot customize the $sections array. }
Version | Description |
---|---|
4.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/WP_Customize_Panel/__construct