mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Don't store nonexistent (deleted) menus in the auto-add option. see #13447.
git-svn-id: https://develop.svn.wordpress.org/trunk@14934 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -368,6 +368,8 @@ switch ( $action ) {
|
||||
if ( false !== ( $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) )
|
||||
unset( $nav_menu_option['auto_add'][$key] );
|
||||
}
|
||||
// Remove nonexistent/deleted menus
|
||||
$nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) );
|
||||
update_option( 'nav_menu_options', $nav_menu_option );
|
||||
|
||||
wp_defer_term_counting(false);
|
||||
|
||||
Reference in New Issue
Block a user