mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-20 11:14:28 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@27124 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -102,7 +102,12 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
|
||||
</h1>
|
||||
<ol>
|
||||
|
||||
<?php while ( $ephemera->have_posts() ) : $ephemera->the_post(); ?>
|
||||
<?php
|
||||
while ( $ephemera->have_posts() ) :
|
||||
$ephemera->the_post();
|
||||
$tmp_more = $GLOBALS['more'];
|
||||
$GLOBALS['more'] = 0;
|
||||
?>
|
||||
<li>
|
||||
<article <?php post_class(); ?>>
|
||||
<div class="entry-content">
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user