[wp-trac] [WordPress Trac] #12651: $pages global not updated with multiple WP_Query objects/post loops

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 20 01:51:00 UTC 2010


#12651: $pages global not updated with multiple WP_Query objects/post loops
--------------------------+-------------------------------------------------
 Reporter:  misterbisson  |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:            
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 setup_postdata() in wp-includes/query.php globalizes the $pages var, then
 assigns it to either $pages = explode(...) or $pages[0] =
 $post->post_content depending on whether the $post->post_content is
 paginated.

 However, the var is not properly reset when displaying posts in additional
 post loops on a given page that is paginated. As coded, only $pages[0] is
 reset, leaving other elements of the array unchanged. The attached patch
 corrects the problem.

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


More information about the wp-trac mailing list