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:
parent
8a80f80b22
commit
9f1d1ba7fa
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue