WordPress at a glance

unregister_nav_menu() WP 1.0

Unregisters a navigation menu location for a theme.

  • Global. Array. $_wp_registered_nav_menus

No Hooks.

Return

true/false. True on success, false on failure.

Usage

unregister_nav_menu( $location );
$location(string) (required)
The menu location identifier.

Code of unregister_nav_menu: wp-includes/nav-menu.php VER 4.9.8

<?php
function unregister_nav_menu( $location ) {
	global $_wp_registered_nav_menus;

	if ( is_array( $_wp_registered_nav_menus ) && isset( $_wp_registered_nav_menus[$location] ) ) {
		unset( $_wp_registered_nav_menus[$location] );
		if ( empty( $_wp_registered_nav_menus ) ) {
			_remove_theme_support( 'menus' );
		}
		return true;
	}
	return false;
}

Related Functions

From tag: nav menu (nav_menu)

More from category: Other Theme Functions

No comments
    Hello, !     Log In . Register