Make WordPress Core

Changeset 27124


Ignore:
Timestamp:
02/07/2014 06:03:00 PM (11 years ago)
Author:
lancewillett
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php

    r26698 r27124  
    103103            <ol>
    104104
    105                 <?php while ( $ephemera->have_posts() ) : $ephemera->the_post(); ?>
     105                <?php
     106                    while ( $ephemera->have_posts() ) :
     107                        $ephemera->the_post();
     108                        $tmp_more = $GLOBALS['more'];
     109                        $GLOBALS['more'] = 0;
     110                ?>
    106111                <li>
    107112                <article <?php post_class(); ?>>
     
    195200            wp_reset_postdata();
    196201
     202            $GLOBALS['more']          = $tmp_more;
    197203            $GLOBALS['content_width'] = $tmp_content_width;
    198204
Note: See TracChangeset for help on using the changeset viewer.