Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#18072 closed defect (bug) (duplicate)

Custom post type count for custom taxonomy incorrect because it includes revisions

Reported by: danielbachhuber's profile danielbachhuber 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)

#1 @nacin
15 years ago

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.

#2 @danielbachhuber
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.

#3 @danielbachhuber
15 years ago

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

#4 @danielbachhuber
15 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #14084

#5 @kawauso
15 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.