diff --git a/wp-includes/theme.php b/wp-includes/theme.php index f063bc97a0..81c91ab5cc 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -840,6 +840,13 @@ function switch_theme( $stylesheet ) { $new_theme->delete_pattern_cache(); $old_theme->delete_pattern_cache(); + // Set autoload=no for the old theme, autoload=yes for the switched theme. + $theme_mods_options = array( + 'theme_mods_' . $stylesheet => 'yes', + 'theme_mods_' . $old_theme->get_stylesheet() => 'no', + ); + wp_set_option_autoload_values( $theme_mods_options ); + /** * Fires after the theme is switched. * diff --git a/wp-includes/version.php b/wp-includes/version.php index f33f5ff7ee..d80bbd3d10 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57152'; +$wp_version = '6.5-alpha-57153'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.