Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#33234 new defect (bug)

Tags/Categories Count Incorrect

Reported by: mikedunn Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: dev-feedback
Focuses: Cc:


The tags and categories management pages show inaccurate count when posts are marked private.

Change History (3)

#1 @swissspidy
3 years ago

  • Keywords close added

That's by design. The _update_post_term_count function only counts published posts.

#2 @mikedunn
3 years ago

If that's by design, then I guess what I'm suggesting is that the design is bad. :) What the interface is indicating now is that there are *no* posts assigned to these "0" count tags/categories, which usually isn't the case. What prompted this is that I deleted a bunch of tags that appeared at first glance to be orphaned, but of course they weren't.

A lazy workaround might be include a line that indicates that only published posts are included, but a better solution in my opinion would be to include all posts regardless of status. Private posts are, in fact, still posts.

#3 @swissspidy
3 years ago

  • Keywords dev-feedback added; close removed
  • Version 4.2.3 deleted

Counting private posts could lead to the opposite situation where a user sees a higher count than the amount of posts he's really able to access. Besides that, what about future posts – shouldn't they be counted as well then?

Would be great getting feedback from some other devs about this as the query itself is quite old.

Note: See TracTickets for help on using tickets.