HTTP/2 301
server: nginx
date: Sat, 11 Oct 2025 21:44:02 GMT
content-type: text/html; charset=UTF-8
location: https://developer.wordpress.org/reference/functions/wp_nav_menu_disabled_check/
x-content-type-options: nosniff
content-language: en
x-ua-compatible: IE=Edge
vary: Accept-Encoding, Cookie
expires: Thu, 01 Jan 1970 00:00:00 GMT
cache-control: no-cache, no-store, max-age=0, must-revalidate
pragma: no-cache
alt-svc: h3=":443"; ma=86400
strict-transport-security: max-age=31536000
HTTP/2 200
server: nginx
date: Sat, 11 Oct 2025 21:44:04 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
wp_nav_menu_disabled_check() – Function | Developer.WordPress.org
WordPress Developer Resources
wp_nav_menu_disabled_check()
wp_nav_menu_disabled_check( int|string $nav_menu_selected_id, bool $display = true ): string|false
Check whether to disable the Menu Locations meta box submit button and inputs.
$nav_menu_selected_id
int|stringrequiredID, name, or slug of the currently selected menu.
$display
booloptionalWhether to display or just return the string.
Default:true
string|false Disabled attribute if at least one menu exists, false if not.
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 );
}
View all references View on Trac View on GitHub
Version | Description |
---|
5.3.1 | The $display parameter was added. |
3.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.