mirror of
https://github.com/WordPress/WordPress.git
synced 2024-06-29 00:04:58 +02:00
Customizer: Account for legacy menu data
Checks for menu location data from when a previewed theme was previously active. See #39692. Built from https://develop.svn.wordpress.org/trunk@41810 git-svn-id: http://core.svn.wordpress.org/trunk@41644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8d773262f3
commit
a22bb4f3ad
|
@ -597,7 +597,14 @@ final class WP_Customize_Nav_Menus {
|
||||||
// Attempt to re-map the nav menu location assignments when previewing a theme switch.
|
// Attempt to re-map the nav menu location assignments when previewing a theme switch.
|
||||||
$mapped_nav_menu_locations = array();
|
$mapped_nav_menu_locations = array();
|
||||||
if ( ! $this->manager->is_theme_active() ) {
|
if ( ! $this->manager->is_theme_active() ) {
|
||||||
$mapped_nav_menu_locations = wp_map_nav_menu_locations( get_nav_menu_locations(), $this->original_nav_menu_locations );
|
$theme_mods = get_option( 'theme_mods_' . $this->manager->get_stylesheet(), array() );
|
||||||
|
|
||||||
|
// If there is no data from a previous activation, start fresh.
|
||||||
|
if ( empty( $theme_mods['nav_menu_locations'] ) ) {
|
||||||
|
$theme_mods['nav_menu_locations'] = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$mapped_nav_menu_locations = wp_map_nav_menu_locations( $theme_mods['nav_menu_locations'], $this->original_nav_menu_locations );
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ( $locations as $location => $description ) {
|
foreach ( $locations as $location => $description ) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.9-beta1-41809';
|
$wp_version = '4.9-beta1-41810';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user