From 27097dea2c7ad79a0519a8eb5cc2459159b0a862 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Fri, 7 Feb 2014 18:03:13 +0000 Subject: [PATCH] Twenty Fourteen: fix Ephemera Widget to avoid showing full post content when displayed in single post or page. Restore the global `$more` to its original value after the widget output to avoid any issues caused by changing a global variable. Props obenland, mor10, Frank Klein. See #26961. Built from https://develop.svn.wordpress.org/trunk@27124 git-svn-id: http://core.svn.wordpress.org/trunk@26991 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyfourteen/inc/widgets.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-content/themes/twentyfourteen/inc/widgets.php b/wp-content/themes/twentyfourteen/inc/widgets.php index f78effedb3..1e8b484ea1 100644 --- a/wp-content/themes/twentyfourteen/inc/widgets.php +++ b/wp-content/themes/twentyfourteen/inc/widgets.php @@ -102,7 +102,12 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
    - have_posts() ) : $ephemera->the_post(); ?> + have_posts() ) : + $ephemera->the_post(); + $tmp_more = $GLOBALS['more']; + $GLOBALS['more'] = 0; + ?>
  1. >
    @@ -194,6 +199,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { // Reset the post globals as this query will have stomped on it. wp_reset_postdata(); + $GLOBALS['more'] = $tmp_more; $GLOBALS['content_width'] = $tmp_content_width; endif; // End check for ephemeral posts.