WP_Customize_Panel::__construct() – Constructor.

You appear to be a bot. Output may be restricted

Description

Constructor.

Any supplied $args override class property defaults.

Usage

WP_Customize_Panel::__construct( $manager, $id, $args );

Parameters

$manager
( WP_Customize_Manager ) required – Customizer bootstrap instance.
$id
( string ) required – A specific ID for the panel.
$args
( array ) optional – { Optional. Array of properties for the new Panel object. Default empty array.
$priority
( int ) optional – Priority of the panel, defining the display order of panels and sections. Default 160.
$capability
( string ) optional – Capability required for the panel. Default `edit_theme_options`.
$theme_supports
( mixed[] ) optional – Theme features required to support the panel.
$title
( string ) optional – Title of the panel to show in UI.
$description
( string ) optional – Description to show in the UI.
$type
( string ) optional – Type of the panel.
$active_callback
( callable ) optional – Active callback. }

Returns

void

Source

File name: wordpress/wp-includes/class-wp-customize-panel.php
Lines:

1 to 18 of 18
  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->WP_Customize_Panel::active_callback ) ) {
      $this->WP_Customize_Panel::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.
  }
 

 View on GitHub View on Trac