Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r25232 r24680  
    301301                                                wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title );
    302302                                                // Auto-save nav_menu_locations
    303                                                 $locations = get_nav_menu_locations();
    304                                                 foreach ( $locations as $location => $menu_id ) {
     303                                                $locations = get_theme_mod( 'nav_menu_locations' );
     304                                                foreach ( (array) $locations as $location => $menu_id ) {
    305305                                                                $locations[ $location ] = $nav_menu_selected_id;
    306306                                                                break; // There should only be 1
     
    309309                                        }
    310310                                        if ( isset( $_REQUEST['use-location'] ) ) {
    311                                                 $locations = get_registered_nav_menus();
    312                                                 $menu_locations = get_nav_menu_locations();
    313                                                 if ( isset( $locations[ $_REQUEST['use-location'] ] ) )
    314                                                         $menu_locations[ $_REQUEST['use-location'] ] = $nav_menu_selected_id;
    315                                                 set_theme_mod( 'nav_menu_locations', $menu_locations );
     311                                                $locations = get_theme_mod( 'nav_menu_locations' );
     312                                                if ( isset( $locations[$_REQUEST['use-location']] ) )
     313                                                        $locations[$_REQUEST['use-location']] = $nav_menu_selected_id;
     314                                                set_theme_mod( 'nav_menu_locations', $locations );
    316315                                        }
    317316                                        // $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%s</strong> has been created.' ), $nav_menu_selected_title ) . '</p></div>';
Note: See TracChangeset for help on using the changeset viewer.