Skip to content

Commit 6f6bc33

Browse files
author
karmatosed
committed
Twenty Elevent Ephemera widget fix for caching in Customizer preview.
Fixes #36429. Props anneschmidt, westonruter. git-svn-id: https://develop.svn.wordpress.org/trunk@37590 602fd350-edb4-49c9-b593-d223f7449a82
1 parent b87bd75 commit 6f6bc33

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/wp-content/themes/twentyeleven/inc/widgets.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function widget( $args, $instance ) {
5656
if ( ! isset( $args['widget_id'] ) )
5757
$args['widget_id'] = null;
5858

59-
if ( isset( $cache[ $args['widget_id'] ] ) ) {
59+
if ( ! is_customize_preview() && isset( $cache[ $args['widget_id'] ] ) ) {
6060
echo $cache[ $args['widget_id'] ];
6161
return;
6262
}
@@ -132,7 +132,10 @@ function widget( $args, $instance ) {
132132
endif;
133133

134134
$cache[ $args['widget_id'] ] = ob_get_flush();
135-
wp_cache_set( 'widget_twentyeleven_ephemera', $cache, 'widget' );
135+
if ( ! is_customize_preview() ) {
136+
wp_cache_set( 'widget_twentyeleven_ephemera', $cache, 'widget' );
137+
}
138+
136139
}
137140

138141
/**

0 commit comments

Comments
 (0)