Opened 15 years ago
Closed 13 years ago
#17027 closed enhancement (duplicate)
Allow WP_Query to return just the count
| Reported by: | scribu | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Query | Version: | |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
Description
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
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I refreshed the patch of #17019