[wp-trac] [WordPress Trac] #17066: $wp_query->found_posts is set to 0 with posts_per_page=-1

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 6 19:25:57 UTC 2011


#17066: $wp_query->found_posts is set to 0 with posts_per_page=-1
--------------------------+-----------------------------
 Reporter:  patrik bona   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  3.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 If I modify/create new WP_Query object with parameter posts_per_page=-1
 (or showposts=-1), then $wp_query->found_posts has incorrect value. It
 always return 0 instead of count of found posts.

 If I don't set posts_per_page, or set it to some positive number, then it
 is set to correct value.

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


More information about the wp-trac mailing list