WP_Customize_Panel::__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) An specific ID for the panel.
- $args
-
(Optional) Panel arguments.
Default value: array()
Source
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.
}
Changelog
Version | Description |
---|---|
WP-4.0.0 | Introduced. |