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

WordPress Trac wp-trac at lists.automattic.com
Wed May 20 00:14:44 GMT 2009


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

Comment(by ryan):

 Stick a loop in sidebar.php of the default theme to see:

 {{{
 $recent = new WP_Query('showposts=10');
 while ( $recent->have_posts() ) {
         $recent->the_post();
         var_dump($post);
 }
 }}}

 $post never changes

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


More information about the wp-trac mailing list