Constructor.
Description
Any supplied $args override class property defaults.
Parameters
$manager
WP_Customize_Managerrequired- Customizer bootstrap instance.
$id
stringrequired- A specific ID for the panel.
$args
arrayoptional- Array of properties for the new Panel object.
priority
intPriority of the panel, defining the display order of panels and sections. Default 160.capability
stringCapability required for the panel.
Defaultedit_theme_options
.theme_supports
mixed[]Theme features required to support the panel.title
stringTitle of the panel to show in UI.description
stringDescription to show in the UI.type
stringType of the panel.active_callback
callableActive callback.
Default:
array()
Source
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 |
---|---|
4.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.