Ticket #23119: 23119.4.diff
File 23119.4.diff, 1.1 KB (added by , 12 years ago) |
---|
-
wp-admin/nav-menus.php
264 264 // Get existing menu locations assignments 265 265 $locations = get_registered_nav_menus(); 266 266 $menu_locations = get_nav_menu_locations(); 267 if ( empty( $menu_locations ) || ! is_array( $menu_locations ) ) 268 $menu_locations = array(); 267 269 268 270 // Remove menu locations that have been unchecked 269 271 foreach ( $locations as $location => $description ) { … … 371 373 $nav_menu_selected_id = $nav_menus[0]->term_id; 372 374 373 375 // Set $nav_menu_selected_id to 0 if no menus 374 if ( $one_theme_location_no_menus ) 376 if ( $one_theme_location_no_menus ) { 375 377 $nav_menu_selected_id = 0; 378 } elseif ( empty( $nav_menu_selected_id ) && ! empty( $nav_menus ) && ! $add_new_screen ) { 379 // if we have no selection yet, and we have menus, set to the first one in the list 380 $nav_menu_selected_id = $nav_menus[0]->term_id; 381 } 376 382 377 383 // Update the user's setting 378 384 if ( $nav_menu_selected_id != $recently_edited && is_nav_menu( $nav_menu_selected_id ) )