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

git-svn-id: http://svn.automattic.com/wordpress/trunk@15467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-07-22 20:50:11 +00:00
parent 8a80f80b22
commit 9f1d1ba7fa
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.
*