Make WordPress Core


Ignore:
Timestamp:
10/10/2017 05:07:31 PM (7 years ago)
Author:
obenland
Message:

Menus: Limit mapping to registered locations

Weeds out orphaned locations, so their information will not continue to be mapped to future themes.

Fixes #42121.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/nav-menu.php

    r41801 r41811  
    10851085 */
    10861086function wp_map_nav_menu_locations( $new_nav_menu_locations, $old_nav_menu_locations ) {
    1087     $registered_nav_menus = get_registered_nav_menus();
     1087    $registered_nav_menus   = get_registered_nav_menus();
     1088    $new_nav_menu_locations = array_intersect_key( $new_nav_menu_locations, $registered_nav_menus );
    10881089
    10891090    // Short-circuit if there are no old nav menu location assignments to map.
Note: See TracChangeset for help on using the changeset viewer.