WP_REST_Menus_Controller::get_menu_auto_add( int $menu_id ): bool

In this article

Returns the value of a menu’s auto_add setting.

Parameters

$menu_idintrequired
The menu id to query.

Return

bool The value of auto_add.

Source

protected function get_menu_auto_add( $menu_id ) {
	$nav_menu_option = (array) get_option( 'nav_menu_options', array( 'auto_add' => array() ) );

	return in_array( $menu_id, $nav_menu_option['auto_add'], true );
}

Changelog

VersionDescription
5.9.0Introduced.

User Contributed Notes

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