#18072 closed defect (bug) (duplicate)
Custom post type count for custom taxonomy incorrect because it includes revisions
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
In the column that shows the number of posts of a given custom post type associated with a given custom taxonomy term, the count includes post revisions. This is erroneous and different than the behavior WordPress exhibits for standard taxonomies with standard posts.
Instead, WordPress should count all posts of a given custom post type minus the number of revisions for each post (e.g. each post should only be counted once)
Change History (5)
I'm looking further into the code to see if I can diagnose. Every time I save a revision, the count increments. I still suspect that it's a query problem.
Ok, you win. It's using the 'count' value from the database. What's the best way to close this ticket, and which ticket should I follow?
Thanks,
Daniel
- Resolution set to duplicate
- Status changed from new to closed
Duplicate of #14084

I'm not sure if it's actually revisions that it's counting, rather, it's the number of posts of any type. In which case this would be a duplicate of a few other tickets and is due to deficiencies in the existing taxonomy structure, with a single term only having one term_count field, rather than a term_count field for each post type it is attached to.