X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7f1521bf193b382565eb753043c161f4cb3fcda7..e0feb3b2e5b436a06bbb04fbc838d1cd6ec95399:/wp-admin/nav-menus.php diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index 384a8566..ed9d0523 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -354,7 +354,13 @@ switch ( $action ) { // Update menu items. if ( ! is_wp_error( $_menu_object ) ) { - $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) ); + $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $_nav_menu_selected_id, $nav_menu_selected_title ) ); + + // If the menu ID changed, redirect to the new URL. + if ( $nav_menu_selected_id != $_nav_menu_selected_id ) { + wp_redirect( admin_url( 'nav-menus.php?menu=' . intval( $_nav_menu_selected_id ) ) ); + exit(); + } } } break; @@ -467,6 +473,8 @@ if ( current_theme_supports( 'menus' ) ) { /* * Ensure the user will be able to scroll horizontally * by adding a class for the max menu depth. + * + * @global int $_wp_nav_menu_max_depth */ global $_wp_nav_menu_max_depth; $_wp_nav_menu_max_depth = 0; @@ -477,7 +485,14 @@ if ( is_nav_menu( $nav_menu_selected_id ) ) { $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); } -function wp_nav_menu_max_depth($classes) { +/** + * + * @global int $_wp_nav_menu_max_depth + * + * @param string $classes + * @return string + */ +function wp_nav_menu_max_depth( $classes ) { global $_wp_nav_menu_max_depth; return "$classes menu-max-depth-$_wp_nav_menu_max_depth"; } @@ -549,11 +564,28 @@ get_current_screen()->set_help_sidebar( require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
+

+ 'menu_locations' ) : array( 'panel' => 'nav_menus' ); + printf( + ' %2$s', + esc_url( add_query_arg( array( + array( 'autofocus' => $focus ), + 'return' => urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), + ), admin_url( 'customize.php' ) ) ), + __( 'Manage in Customizer' ) + ); + endif; + ?> +

- -