unregister_nav_menu

Advertisement

Summery Summery

Unregisters a navigation menu location for a theme.

Syntax Syntax

unregister_nav_menu( string $location )

Parameters Parameters

$location

(Required) The menu location identifier.

Return Return

(bool) True on success, false on failure.

Source Source

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;

Advertisement

Changelog Changelog

Changelog
Version Description
3.1.0 Introduced.

Advertisement

Leave a Reply