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_Managerrequired
Customizer bootstrap instance.
$idstringrequired
A specific ID of the setting.
Can be a theme mod or option name.
$argsarrayoptional
Setting arguments.

Default:array()

Source

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

Changelog

VersionDescription
4.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.