WP_Customize_Nav_Menu_Setting::filter_nav_menu_options( array $nav_menu_options )

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

Parameters

$nav_menu_options

(array) (Required) Nav menu options including auto_add.

Return

(array) (Maybe) modified nav menu options.

Source

File: wp-includes/customize/class-wp-customize-nav-menu-setting.php

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

Changelog

Version Description
4.3.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_nav_menu_setting/filter_nav_menu_options