Title: WP_Customize_Panel::__construct
Published: September 4, 2014
Last modified: April 28, 2025

---

# WP_Customize_Panel::__construct( WP_Customize_Manager $manager, string $id, array $args = array() )

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#wp--skip-link--target)

Constructor.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#description)󠁿

Any supplied $args override class property defaults.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#parameters)󠁿

 `$manager`[WP_Customize_Manager](https://developer.wordpress.org/reference/classes/wp_customize_manager/)
required

Customizer bootstrap instance.

`$id`stringrequired

A specific ID for the panel.

`$args`arrayoptional

Array of properties for the new Panel object.

 * `priority` int
 * Priority of the panel, defining the display order of panels and sections. Default
   160.
 * `capability` string
 * Capability required for the panel.
    Default `edit_theme_options`.
 * `theme_supports` mixed[]
 * Theme features required to support the panel.
 * `title` string
 * Title of the panel to show in UI.
 * `description` string
 * Description to show in the UI.
 * `type` string
 * Type of the panel.
 * `active_callback` callable
 * Active callback.

Default:`array()`

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#source)󠁿

    ```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.
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-panel.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-customize-panel.php#L162)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-customize-panel.php#L162-L179)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Customize_Manager::add_panel()](https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/)`wp-includes/class-wp-customize-manager.php` |

Adds a customize panel.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_customize_panel/__construct/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_customize_panel%2F__construct%2F)
before being able to contribute a note or feedback.