WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/13/2010 08:39:54 PM (10 years ago)
Author:
westi
Message:

Introduce wp_reset_postdata(). Use it to reset the post global for the current query_posts() call after using a loop with a new WP_Query object. Fixes #12320 props scribu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/default-widgets.php

    r14486 r14607  
    555555        <?php echo $after_widget; ?>
    556556<?php
    557             wp_reset_query();  // Restore global post data stomped by the_post().
     557        // Reset the global $the_post as this query will have stomped on it
     558        wp_reset_postdata();
     559
    558560        endif;
    559561
Note: See TracChangeset for help on using the changeset viewer.