WP_Customize_Nav_Menu_Setting::filter_nav_menu_options()publicWP 4.3.0

Filters the nav_menu_options option to include this menu's auto_add preference.

Method of the class: WP_Customize_Nav_Menu_Setting{}

No Hooks.

Return

Array. (Maybe) modified nav menu options.

Usage

$WP_Customize_Nav_Menu_Setting = new WP_Customize_Nav_Menu_Setting();
$WP_Customize_Nav_Menu_Setting->filter_nav_menu_options( $nav_menu_options );
$nav_menu_options(array) (required)
Nav menu options including auto_add.

Changelog

Since 4.3.0 Introduced.

WP_Customize_Nav_Menu_Setting::filter_nav_menu_options() code WP 6.6.2

public function filter_nav_menu_options( $nav_menu_options ) {
	if ( get_current_blog_id() !== $this->_previewed_blog_id ) {
		return $nav_menu_options;
	}

	$menu             = $this->value();
	$nav_menu_options = $this->filter_nav_menu_options_value(
		$nav_menu_options,
		$this->term_id,
		false === $menu ? false : $menu['auto_add']
	);

	return $nav_menu_options;
}