WP_Customize_Nav_Menus::__construct()publicWP 4.3.0

Constructor.

Method of the class: WP_Customize_Nav_Menus{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_Customize_Nav_Menus = new WP_Customize_Nav_Menus();
$WP_Customize_Nav_Menus->__construct( $manager );
$manager(WP_Customize_Manager) (required)
Customizer bootstrap instance.

Changelog

Since 4.3.0 Introduced.

WP_Customize_Nav_Menus::__construct() code WP 6.6.2

public function __construct( $manager ) {
	$this->manager                     = $manager;
	$this->original_nav_menu_locations = get_nav_menu_locations();

	// See https://github.com/xwp/wp-customize-snapshots/blob/962586659688a5b1fd9ae93618b7ce2d4e7a421c/php/class-customize-snapshot-manager.php#L469-L499
	add_action( 'customize_register', array( $this, 'customize_register' ), 11 );
	add_filter( 'customize_dynamic_setting_args', array( $this, 'filter_dynamic_setting_args' ), 10, 2 );
	add_filter( 'customize_dynamic_setting_class', array( $this, 'filter_dynamic_setting_class' ), 10, 3 );
	add_action( 'customize_save_nav_menus_created_posts', array( $this, 'save_nav_menus_created_posts' ) );

	// Skip remaining hooks when the user can't manage nav menus anyway.
	if ( ! current_user_can( 'edit_theme_options' ) ) {
		return;
	}

	add_filter( 'customize_refresh_nonces', array( $this, 'filter_nonces' ) );
	add_action( 'wp_ajax_load-available-menu-items-customizer', array( $this, 'ajax_load_available_items' ) );
	add_action( 'wp_ajax_search-available-menu-items-customizer', array( $this, 'ajax_search_available_items' ) );
	add_action( 'wp_ajax_customize-nav-menus-insert-auto-draft', array( $this, 'ajax_insert_auto_draft_post' ) );
	add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
	add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_templates' ) );
	add_action( 'customize_controls_print_footer_scripts', array( $this, 'available_items_template' ) );
	add_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) );
	add_action( 'customize_preview_init', array( $this, 'make_auto_draft_status_previewable' ) );

	// Selective Refresh partials.
	add_filter( 'customize_dynamic_partial_args', array( $this, 'customize_dynamic_partial_args' ), 10, 2 );
}