Opened 15 years ago
Closed 13 years ago
#17027 closed enhancement (duplicate)
Allow WP_Query to return just the count
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Query | Keywords: | needs-patch |
| Focuses: | Cc: |
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.
I refreshed the patch of #17019