[wp-trac] Re: [WordPress Trac] #9854: wp_query gets poisoned by new WP_Query objects

WordPress Trac wp-trac at lists.automattic.com
Tue May 19 23:03:01 GMT 2009


#9854: wp_query gets poisoned by new WP_Query objects
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |        Owner:  ryan  
     Type:  defect (bug)       |       Status:  closed
 Priority:  normal             |    Milestone:  2.8   
Component:  Query              |      Version:  2.8   
 Severity:  normal             |   Resolution:  fixed 
 Keywords:                     |  
-------------------------------+--------------------------------------------

Comment(by ryan):

 Reports of breakage for loops like this:

 {{{
 $recent = new WP_Query("blah=blah");
 while($recent->have_posts()) {
   $recent->the_post();
   echo $post->ID;
 }
 }}}

 Evidently, $post is not being set.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9854#comment:16>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list