On this page
WP_Customize_Nav_Menu_Setting::__construct( WP_Customize_Manager $manager, string $id, array $args = array() )
Constructor.
Description
Any supplied $args override class property defaults.
Parameters
$managerWP_Customize_Manager Required-
Customizer bootstrap instance.
$idstring Required-
A specific ID of the setting.
Can be a theme mod or option name. $argsarray Optional-
Setting arguments.
Default:
array()
Source
File: wp-includes/customize/class-wp-customize-nav-menu-setting.php. View all references
public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
if ( empty( $manager->nav_menus ) ) {
throw new Exception( 'Expected WP_Customize_Manager::$nav_menus to be set.' );
}
if ( ! preg_match( self::ID_PATTERN, $id, $matches ) ) {
throw new Exception( "Illegal widget setting ID: $id" );
}
$this->term_id = (int) $matches['id'];
parent::__construct( $manager, $id, $args );
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Customize_Setting::__construct() wp-includes/class-wp-customize-setting.php | Constructor. |
Used By
| Used By | Description |
|---|---|
| WP_Customize_Nav_Menus::enqueue_scripts() wp-includes/class-wp-customize-nav-menus.php | Enqueues scripts and styles for Customizer pane. |
| WP_Customize_Nav_Menus::customize_register() wp-includes/class-wp-customize-nav-menus.php | Adds the customizer settings and controls. |
Changelog
| Version | Description |
|---|---|
| 4.3.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_nav_menu_setting/__construct