Make WordPress Core

Ticket #12320: 12320.diff

File 12320.diff, 609 bytes (added by scribu, 15 years ago)
  • wp-includes/default-widgets.php

     
    554554                </ul>
    555555                <?php echo $after_widget; ?>
    556556<?php
    557                         wp_reset_query();  // Restore global post data stomped by the_post().
     557                // Restore global post data stomped by the_post().
     558                global $wp_query;
     559                if ( !empty($wp_query->post) ) {
     560                        $GLOBALS['post'] = $wp_query->post;
     561                        setup_postdata($wp_query->post);
     562                }
     563
    558564                endif;
    559565
    560566                $cache[$args['widget_id']] = ob_get_flush();