[wp-trac] [WordPress Trac] #12320: Invalid call to wp_reset_query() inside Recent Posts widget

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 25 16:41:36 UTC 2010


#12320: Invalid call to wp_reset_query() inside Recent Posts widget
--------------------------+-------------------------------------------------
 Reporter:  michelwppi    |       Owner:  azaozz              
     Type:  defect (bug)  |      Status:  new                 
 Priority:  normal        |   Milestone:  3.0                 
Component:  Widgets       |     Version:  2.9.2               
 Severity:  normal        |    Keywords:  has-patch query loop
--------------------------+-------------------------------------------------

Comment(by scribu):

 There might be some other issue with the reporter's code, but here is the
 problem this ticket is addressing:

 1. The Recent Posts widget creates its own query: $r = new WP_Query(...)

 2. Then, it calls wp_reset_query()

 3. wp_reset_query() unnecessarily changes the $wp_query global (see 1.
 above)

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


More information about the wp-trac mailing list