diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index 9da80dcc7a..821508913d 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -351,6 +351,11 @@ switch ( $action ) { } break; case 'locations': + if ( ! $num_locations ) { + wp_redirect( admin_url( 'nav-menus.php' ) ); + exit(); + } + add_filter( 'screen_options_show_screen', '__return_false' ); if ( isset( $_POST['menu-locations'] ) ) { @@ -466,7 +471,7 @@ add_filter('admin_body_class', 'wp_nav_menu_max_depth'); wp_nav_menu_setup(); wp_initial_nav_menu_meta_boxes(); -if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() ) +if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) $messages[] = '
' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '