Adds a customize control.
$idWP_Customize_Control|stringrequired
$argsarrayoptional
Default:array()
public function add_control( $id, $args = array() ) {
if ( $id instanceof WP_Customize_Control ) {
$control = $id;
} else {
$control = new WP_Customize_Control( $this, $id, $args );
}
$this->controls[ $control->id ] = $control;
return $control;
}
| Version | Description |
|---|---|
| 4.5.0 | Return added WP_Customize_Control instance. |
| 3.4.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control