Title: WP_Customize_Control::__construct
Published: April 25, 2014
Last modified: August 20, 2026

---

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

## In this article

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

Constructor.

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

Supplied `$args` override class property defaults.

If `$args['settings']` is not defined, use the `$id` as the setting ID.

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

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

Customizer bootstrap instance.

`$id`stringrequired

Control ID.

`$args`arrayoptional

Array of properties for the new Control object.

 * `instance_number` int
 * Order in which this instance was created in relation to other instances.
 * `manager` [WP_Customize_Manager](https://developer.wordpress.org/reference/classes/wp_customize_manager/)
 * Customizer bootstrap instance.
 * `id` string
 * Control ID.
 * `settings` array
 * All settings tied to the control. If undefined, `$id` will be used.
 * `setting` string
 * The primary setting for the control (if there is one).
    Default `'default'`.
 * `capability` string
 * Capability required to use this control. Normally this is empty and the capability
   is derived from `$settings`.
 * `priority` int
 * Order priority to load the control. Default 10.
 * `section` string
 * Section the control belongs to.
 * `label` string
 * Label for the control.
 * `description` string
 * Description for the control.
 * `choices` array
 * List of choices for `'radio'` or `'select'` type controls, where values are the
   keys, and labels are the values.
 * `input_attrs` array
 * List of custom input attributes for control output, where attribute names are
   the keys and values are the values. Not used for `'checkbox'`, `'radio'`, `'select'`,
   or `'dropdown-pages'` control types.
 * `allow_addition` bool
 * Show UI for adding new content, currently only used for the dropdown-pages control.
   Default false.
 * `json` array
 * Deprecated. Use [WP_Customize_Control::json()](https://developer.wordpress.org/reference/classes/wp_customize_control/json/)
   instead.
 * `type` string
 * Control type. Core controls include `'text'`, `'checkbox'`, `'textarea'`, `'radio'`,`'
   select'`, and `'dropdown-pages'`. Additional input types such as `'email'`, `'
   url'`, `'number'`, `'hidden'`, and `'date'` are supported implicitly. Default`'
   text'`.
 * `active_callback` callable
 * Active callback.

Default:`array()`

## 󠀁[Source](https://developer.wordpress.org/reference/classes/WP_Customize_Control/__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;

    	// Process settings.
    	if ( ! isset( $this->settings ) ) {
    		$this->settings = $id;
    	}

    	$settings = array();
    	if ( is_array( $this->settings ) ) {
    		foreach ( $this->settings as $key => $setting ) {
    			$settings[ $key ] = $this->manager->get_setting( $setting );
    		}
    	} elseif ( is_string( $this->settings ) ) {
    		$this->setting       = $this->manager->get_setting( $this->settings );
    		$settings['default'] = $this->setting;
    	}
    	$this->settings = $settings;
    }
    ```

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

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

| Used by | Description | 
| [WP_Customize_New_Menu_Control::__construct()](https://developer.wordpress.org/reference/classes/wp_customize_new_menu_control/__construct/)`wp-includes/customize/class-wp-customize-new-menu-control.php` |

Constructor.

  | 
| [WP_Customize_Nav_Menu_Item_Control::__construct()](https://developer.wordpress.org/reference/classes/wp_customize_nav_menu_item_control/__construct/)`wp-includes/customize/class-wp-customize-nav-menu-item-control.php` |

Constructor.

  | 
| [WP_Customize_Media_Control::__construct()](https://developer.wordpress.org/reference/classes/wp_customize_media_control/__construct/)`wp-includes/customize/class-wp-customize-media-control.php` |

Constructor.

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

Adds a customize control.

  | 
| [WP_Customize_Color_Control::__construct()](https://developer.wordpress.org/reference/classes/wp_customize_color_control/__construct/)`wp-includes/customize/class-wp-customize-color-control.php` |

Constructor.

  |

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

| Version | Description | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.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_control%2F__construct%2F)
before being able to contribute a note or feedback.