Make WordPress Core


Ignore:
Timestamp:
07/22/2010 08:50:11 PM (15 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/nav-menu.php

    r15256 r15467  
    7777
    7878    $_wp_registered_nav_menus = array_merge( (array) $_wp_registered_nav_menus, $locations );
     79}
     80
     81/**
     82 * Unregisters a navigation menu for a theme.
     83 *
     84 * @param array $location the menu location identifier
     85 *
     86 * @return bool True on success, false on failure.
     87 */
     88function unregister_nav_menu( $location ) {
     89    global $_wp_registered_nav_menus;
     90
     91    if ( is_array( $_wp_registered_nav_menus ) && isset( $_wp_registered_nav_menus[$location] ) ) {
     92        unset( $_wp_registered_nav_menus[$location] );
     93        return true;
     94    }
     95    return false;
    7996}
    8097
Note: See TracChangeset for help on using the changeset viewer.