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.
git-svn-id: http://core.svn.wordpress.org/trunk@23897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -189,6 +189,14 @@ function wp_delete_nav_menu( $menu ) {
|
||||
|
||||
$result = wp_delete_term( $menu->term_id, 'nav_menu' );
|
||||
|
||||
// Remove this menu from any locations.
|
||||
$locations = get_theme_mod( 'nav_menu_locations' );
|
||||
foreach ( (array) $locations as $location => $menu_id ) {
|
||||
if ( $menu_id == $nav_menu_id )
|
||||
$locations[ $location ] = 0;
|
||||
}
|
||||
set_theme_mod( 'nav_menu_locations', $locations );
|
||||
|
||||
if ( $result && !is_wp_error($result) )
|
||||
do_action( 'wp_delete_nav_menu', $menu->term_id );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user