#18072 closed defect (bug) (duplicate)
Custom post type count for custom taxonomy incorrect because it includes revisions
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Taxonomy | Keywords: | |
| Focuses: | 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)
#2
@
15 years ago
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.
Note: See
TracTickets for help on using
tickets.
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.