Ticket #14001: nav-menu.php.15288.2.patch

File nav-menu.php.15288.2.patch, 837 bytes (added by jorbin, 2 years ago)
  • wp-includes/nav-menu.php

     
    7878        $_wp_registered_nav_menus = array_merge( (array) $_wp_registered_nav_menus, $locations ); 
    7979} 
    8080 
     81 
    8182/** 
     83 * Unregisters a navigation menu for a theme. 
     84 * 
     85 * @param array $location the menu location identifier 
     86 * 
     87 * @return bool true if location was unregistered 
     88 */ 
     89function unregister_nav_menu( $location ) { 
     90        global $_wp_registered_nav_menus; 
     91 
     92        if (is_array($_wp_registered_nav_menus) && array_key_exists( $location, $_wp_registered_nav_menus ) ){ 
     93                unset( $_wp_registered_nav_menus[$location] ); 
     94                return true; 
     95        } 
     96 
     97        return false; 
     98 
     99} 
     100 
     101 
     102 
     103/** 
    82104 * Register a navigation menu for a theme. 
    83105 * 
    84106 * @since 3.0.0