Make WordPress Core

Changeset 41810


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

Customizer: Account for legacy menu data

Checks for menu location data from when a previewed theme was previously active.

See #39692.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r41792 r41810  
    598598        $mapped_nav_menu_locations = array();
    599599        if ( ! $this->manager->is_theme_active() ) {
    600             $mapped_nav_menu_locations = wp_map_nav_menu_locations( get_nav_menu_locations(), $this->original_nav_menu_locations );
     600            $theme_mods = get_option( 'theme_mods_' . $this->manager->get_stylesheet(), array() );
     601
     602            // If there is no data from a previous activation, start fresh.
     603            if ( empty( $theme_mods['nav_menu_locations'] ) ) {
     604                $theme_mods['nav_menu_locations'] = array();
     605            }
     606
     607            $mapped_nav_menu_locations = wp_map_nav_menu_locations( $theme_mods['nav_menu_locations'], $this->original_nav_menu_locations );
    601608        }
    602609
Note: See TracChangeset for help on using the changeset viewer.