wp_nav_menu_disabled_check( int|string $nav_menu_selected_id, bool $display = true ): string|false

In this article

Check whether to disable the Menu Locations meta box submit button and inputs.

Parameters

$nav_menu_selected_idint|stringrequired
ID, name, or slug of the currently selected menu.
$displaybooloptional
Whether to display or just return the string.

Default:true

Return

string|false Disabled attribute if at least one menu exists, false if not.

Source

function wp_nav_menu_disabled_check( $nav_menu_selected_id, $display = true ) {
	global $one_theme_location_no_menus;

	if ( $one_theme_location_no_menus ) {
		return false;
	}

	return disabled( $nav_menu_selected_id, 0, $display );
}

Changelog

VersionDescription
5.3.1The $display parameter was added.
3.6.0Introduced.

User Contributed Notes

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