Make WordPress Core


Ignore:
Timestamp:
08/12/2015 02:06:21 PM (9 years ago)
Author:
boonebgorges
Message:

When splitting a shared 'nav_menu' term, ensure that nav items and theme locations are retained.

Props boonebgorges, dd32.
Fixes #33187.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/nav-menus.php

    r33355 r33611  
    355355            // Update menu items.
    356356            if ( ! is_wp_error( $_menu_object ) ) {
    357                 $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) );
     357                $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $_nav_menu_selected_id, $nav_menu_selected_title ) );
     358
     359                // If the menu ID changed, redirect to the new URL.
     360                if ( $nav_menu_selected_id != $_nav_menu_selected_id ) {
     361                    wp_redirect( admin_url( 'nav-menus.php?menu=' . intval( $_nav_menu_selected_id ) ) );
     362                    exit();
     363                }
    358364            }
    359365        }
Note: See TracChangeset for help on using the changeset viewer.