WP_Customize_Nav_Menus::customize_preview_init() WordPress Method

The WP_Customize_Nav_Menus::customize_preview_init() method is used to initialize menu customizations in the WordPress Customizer. This method includes calls to the add_action() and remove_action() methods, which respectively add and remove the filters and actions needed for menu customizations.

WP_Customize_Nav_Menus::customize_preview_init() #

Adds hooks for the Customizer preview.


Source

File: wp-includes/class-wp-customize-nav-menus.php

	public function customize_preview_init() {
		add_action( 'wp_enqueue_scripts', array( $this, 'customize_preview_enqueue_deps' ) );
		add_filter( 'wp_nav_menu_args', array( $this, 'filter_wp_nav_menu_args' ), 1000 );
		add_filter( 'wp_nav_menu', array( $this, 'filter_wp_nav_menu' ), 10, 2 );
		add_filter( 'wp_footer', array( $this, 'export_preview_data' ), 1 );
		add_filter( 'customize_render_partials_response', array( $this, 'export_partial_rendered_nav_menu_instances' ) );
	}


Top ↑

Changelog

Changelog
VersionDescription
4.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.