unregister_nav_menu
Unregisters a navigation menu location for a theme.
Description
unregister_nav_menu( (string) $location );
Parameters (1)
- 0. $location (string)
- The menu location identifier.
Usage
if ( !function_exists( 'unregister_nav_menu' ) ) { require_once ABSPATH . WPINC . '/nav-menu.php'; } // The menu location identifier. $location = ''; // NOTICE! Understand what this does before running. $result = unregister_nav_menu($location);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/nav-menu.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;
- }