WordPress.org

Make WordPress Core

Changeset 15466


Ignore:
Timestamp:
07/22/2010 08:49:47 PM (8 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

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

    r15256 r15466  
    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.