[wp-trac] [WordPress Trac] #17027: Allow WP_Query to return just the count

WordPress Trac wp-trac at lists.automattic.com
Sat Apr 2 18:32:56 UTC 2011


#17027: Allow WP_Query to return just the count
-------------------------+----------------------------
 Reporter:  scribu       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Future Release
Component:  Query        |    Version:
 Severity:  normal       |   Keywords:  needs-patch
-------------------------+----------------------------
 Currently, you can't ask just for the total number of posts for a certain
 query.

 You have to execute that query and then retrieve the total using
 SQL_CALC_FOUND_ROWS.

 Maybe a {{{'fields' => 'count'}}} option would do it.

 Example where this is needed in Core: #17019

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


More information about the wp-trac mailing list