Ticket #33628: wp_theme_mods_cache1.patch
| File wp_theme_mods_cache1.patch, 2.2 KB (added by , 11 years ago) |
|---|
-
wp-includes/theme.php
diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 07b0f6a..98d806f 100644
a b function locale_stylesheet() { 671 671 * @global array $wp_theme_directories 672 672 * @global WP_Customize_Manager $wp_customize 673 673 * @global array $sidebars_widgets 674 * @global array $wp_theme_mods 674 675 * 675 676 * @param string $stylesheet Stylesheet name 676 677 */ 677 678 function switch_theme( $stylesheet ) { 678 global $wp_theme_directories, $wp_customize, $sidebars_widgets ;679 global $wp_theme_directories, $wp_customize, $sidebars_widgets, $wp_theme_mods; 679 680 681 $wp_theme_mods = false; 680 682 $_sidebars_widgets = null; 681 683 if ( 'wp_ajax_customize_save' === current_action() ) { 682 684 $_sidebars_widgets = $wp_customize->post_value( $wp_customize->get_setting( 'old_sidebars_widgets_data' ) ); … … function validate_current_theme() { 796 798 * Retrieve all theme modifications. 797 799 * 798 800 * @since 3.1.0 801 * @global array $wp_theme_mods 799 802 * 800 803 * @return array|void Theme modifications. 801 804 */ 802 805 function get_theme_mods() { 803 $theme_slug = get_option( 'stylesheet' ); 804 $mods = get_option( "theme_mods_$theme_slug" ); 805 if ( false === $mods ) { 806 $theme_name = get_option( 'current_theme' ); 807 if ( false === $theme_name ) 808 $theme_name = wp_get_theme()->get('Name'); 809 $mods = get_option( "mods_$theme_name" ); // Deprecated location. 810 if ( is_admin() && false !== $mods ) { 811 update_option( "theme_mods_$theme_slug", $mods ); 812 delete_option( "mods_$theme_name" ); 806 global $wp_theme_mods; 807 808 if ( empty( $wp_theme_mods ) ) { 809 $theme_slug = get_option( 'stylesheet' ); 810 $wp_theme_mods = get_option( "theme_mods_$theme_slug" ); 811 if ( false === $wp_theme_mods ) { 812 $theme_name = get_option( 'current_theme' ); 813 if ( false === $theme_name ) { 814 $theme_name = wp_get_theme()->get( 'Name' ); 815 } 816 $wp_theme_mods = get_option( "mods_$theme_name" ); // Deprecated location. 817 if ( is_admin() && false !== $wp_theme_mods ) { 818 update_option( "theme_mods_$theme_slug", $wp_theme_mods ); 819 delete_option( "mods_$theme_name" ); 820 } 813 821 } 814 822 } 815 return $ mods;823 return $wp_theme_mods; 816 824 } 817 825 818 826 /**
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)