Make WordPress Core


Ignore:
Timestamp:
04/04/2013 04:28:12 AM (12 years ago)
Author:
nacin
Message:

Remove _wp_delete_nav_menu(). wp_delete_nav_menu() should instead remove the menu from theme locations, which was the only difference between the functions. see #23119.

File:
1 edited

Legend:

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

    r23554 r23897  
    189189
    190190    $result = wp_delete_term( $menu->term_id, 'nav_menu' );
     191
     192    // Remove this menu from any locations.
     193    $locations = get_theme_mod( 'nav_menu_locations' );
     194    foreach ( (array) $locations as $location => $menu_id ) {
     195        if ( $menu_id == $nav_menu_id )
     196            $locations[ $location ] = 0;
     197    }
     198    set_theme_mod( 'nav_menu_locations', $locations );
    191199
    192200    if ( $result && !is_wp_error($result) )
Note: See TracChangeset for help on using the changeset viewer.