Make WordPress Core

Opened 9 years ago

Last modified 19 months ago

#33234 new defect (bug)

Tags/Categories Count Incorrect

Reported by: mikedunn's profile mikedunn Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: dev-feedback
Focuses: administration Cc:

Description

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

Change History (5)

#1 @swissspidy
9 years ago

  • Keywords close added

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

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

#4 @sabernhardt
19 months ago

Since 5.7, the update_post_term_count_statuses filter has allowed modifying the list of statuses. See #38843.

#5 @sabernhardt
19 months ago

  • Component changed from General to Taxonomy
  • Focuses administration added
Note: See TracTickets for help on using tickets.