Add unregister_nav_menu(). props jorbin, fixes #14001 for 3.1.

git-svn-id: https://develop.svn.wordpress.org/trunk@15467 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-07-22 20:50:11 +00:00
parent 04e5e859d8
commit 7c3292bb4a
1 changed files with 17 additions and 0 deletions

View File

@ -78,6 +78,23 @@ function register_nav_menus( $locations = array() ) {
$_wp_registered_nav_menus = array_merge( (array) $_wp_registered_nav_menus, $locations );
}
/**
* Unregisters a navigation menu for a theme.
*
* @param array $location the menu location identifier
*
* @return bool True on success, false on failure.
*/
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] );
return true;
}
return false;
}
/**
* Register a navigation menu for a theme.
*