Uses
| Uses | Description |
|---|---|
| wp-includes/theme.php: _remove_theme_support() | Do not use. Removes theme support internally without knowledge of those not used by themes directly. |
Unregisters a navigation menu location for a theme.
(string) (Required) The menu location identifier.
(bool) True on success, false on failure.
unregister_nav_menu( 'primary' );
File: 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;
} | Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/unregister_nav_menu