WP_REST_Menus_Controller::get_menu_auto_add( int $menu_id ): bool

Returns the value of a menu’s auto_add setting.


Parameters

$menu_id int Required
The menu id to query.

Top ↑

Return

bool The value of auto_add.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
5.9.0 Introduced.

Top ↑

User Contributed Notes

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