wp_nav_menu_disabled_check

Advertisement

Summery Summery

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

Syntax Syntax

wp_nav_menu_disabled_check( int|string $nav_menu_selected_id, bool $echo = true )

Parameters Parameters

$nav_menu_selected_id

(Required) ID, name, or slug of the currently selected menu.

$echo

(Optional) Whether to echo or just return the string.

Default value: true

Return Return

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

Source Source

File: wp-admin/includes/nav-menu.php

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

	if ( $one_theme_location_no_menus ) {
		return false;
	}

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

Advertisement

Changelog Changelog

Changelog
Version Description
5.3.1 The $echo parameter was added.
3.6.0 Introduced.

Advertisement

Leave a Reply