WP_Customize_Nav_Menu_Setting::__construct()publicWP 4.3.0


Any supplied $args override class property defaults.

Метод класса: WP_Customize_Nav_Menu_Setting{}

Хуков нет.


null. Ничего (null).


$WP_Customize_Nav_Menu_Setting = new WP_Customize_Nav_Menu_Setting();
$WP_Customize_Nav_Menu_Setting->__construct( $manager, $id, $args );
$manager(WP_Customize_Manager) (обязательный)
Customizer bootstrap instance.
$id(строка) (обязательный)
A specific ID of the setting. Can be a theme mod or option name.
Setting arguments.
По умолчанию: array()

Список изменений

С версии 4.3.0 Введена.

Код WP_Customize_Nav_Menu_Setting::__construct() WP 6.6

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 );