Use get_nav_menu_locations() in wp_delete_nav_menu().
props nofearinc. see #25064. Built from https://develop.svn.wordpress.org/trunk@25196 git-svn-id: http://core.svn.wordpress.org/trunk@25168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8e56222a1a
commit
0d9fcbd841
Binary file not shown.
|
@ -190,8 +190,8 @@ function wp_delete_nav_menu( $menu ) {
|
||||||
$result = wp_delete_term( $menu->term_id, 'nav_menu' );
|
$result = wp_delete_term( $menu->term_id, 'nav_menu' );
|
||||||
|
|
||||||
// Remove this menu from any locations.
|
// Remove this menu from any locations.
|
||||||
$locations = get_theme_mod( 'nav_menu_locations' );
|
$locations = get_nav_menu_locations();
|
||||||
foreach ( (array) $locations as $location => $menu_id ) {
|
foreach ( $locations as $location => $menu_id ) {
|
||||||
if ( $menu_id == $menu->term_id )
|
if ( $menu_id == $menu->term_id )
|
||||||
$locations[ $location ] = 0;
|
$locations[ $location ] = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue