[wp-trac] [WordPress Trac] #24785: Nested loops and resetting post data

WordPress Trac noreply at wordpress.org
Wed Jul 17 16:00:27 UTC 2013

#24785: Nested loops and resetting post data
 Reporter:  ericlewis    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Query        |    Version:
 Severity:  normal       |   Keywords:
 While building a custom loop, developers currently only have one function
 to reset post data - wp_reset_postdata(). This function resets the $post
 globals and thereby template tags to the original queried object in the
 $wp_query global. That's great, but not when it comes to nested loops.
 Using this function when you're deep within a nest of custom loops would
 mean upon exiting a loop, calling this function resets to the original
 queried object, although you're still within a loop that has posts related
 to it.

Ticket URL: <http://core.trac.wordpress.org/ticket/24785>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list