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

git-svn-id: http://svn.automattic.com/wordpress/branches/3.0@15466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-07-22 20:49:47 +00:00
parent bfaede1cee
commit f7faa5e8c7
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.
*