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

WordPress Trac wp-trac at lists.automattic.com
Sun May 17 21:48:22 GMT 2009


#9854: wp_the_query gets poisoned by new WP_Query objects
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |       Owner:  ryan
     Type:  defect (bug)       |      Status:  new 
 Priority:  normal             |   Milestone:  2.8 
Component:  Query              |     Version:  2.8 
 Severity:  normal             |    Keywords:      
-------------------------------+--------------------------------------------
 See #7080 and #9458 for reference material.

 Code to duplicate the issue:

 {{{
 while ( have_post() ) {
   the_post();
   the_title();
   the_widget('WP_Widget_Recent_Posts');
   the_content();
 }
 }}}

 In the Recent Posts widget, add the following after the_post() to see
 things happening:

 {{{
 var_dump($GLOBALS['wp_the_query']->post->ID);
 }}}

 You'll notice is changes for no obvious reason.

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


More information about the wp-trac mailing list