Ticket #39537: 39537.diff
File 39537.diff, 1.3 KB (added by , 7 years ago) |
---|
-
src/wp-includes/theme.php
737 737 set_theme_mod( 'nav_menu_locations', $nav_menu_locations ); 738 738 } 739 739 } 740 741 $autoload_options = wp_cache_get( 'alloptions', 'options' ); 742 if ( ! is_array( $autoload_options ) ) { 743 $autoload_options = array(); 744 } 745 746 if ( ! in_array( "theme_mods_$stylesheet", $autoload_options ) ) { 747 // If the switched theme options are not autoload, update to autoload=yes 748 $theme_mods = get_option( "theme_mods_$stylesheet" ); 749 delete_option( "theme_mods_$stylesheet" ); 750 add_option( "theme_mods_$stylesheet", $theme_mods ); 751 } 740 752 } 741 753 742 754 update_option( 'theme_switched', $old_theme->get_stylesheet() ); 743 755 756 // Set autoload=no for the previous theme (delete and add the option again is needed for this purpose) 757 $old_theme_stylesheet = $old_theme->get_stylesheet(); 758 $old_theme_mods = get_option( "theme_mods_$old_theme_stylesheet" ); 759 delete_option( "theme_mods_$old_theme_stylesheet" ); 760 add_option( "theme_mods_$old_theme_stylesheet", $old_theme_mods, null, 'no' ); 761 762 // Reload autoload options 763 wp_load_alloptions(); 764 744 765 /** 745 766 * Fires after the theme is switched. 746 767 *