[wp-trac] [WordPress Trac] #64853: Inconsistent Post Count in Category Taxonomy
WordPress Trac
noreply at wordpress.org
Mon Mar 16 14:03:05 UTC 2026
#64853: Inconsistent Post Count in Category Taxonomy
-------------------------------------+---------------------------------
Reporter: phunsanit | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.9.4
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses: ui, administration
-------------------------------------+---------------------------------
Comment (by shreyasikhar26):
Hey @phunsanit / @maulikmakwana2008
This inconsistency isn’t limited to **scheduled** posts; it can also occur
with **draft**, **pending**, **private** or any other custom post
statuses.
Also, WordPress has provided a filter `update_post_term_count_statuses`,
by using it we can decide which statuses we can allow to update the term
count.
Code reference: https://github.com/WordPress/wordpress-
develop/blob/trunk/src/wp-includes/taxonomy.php#L4182
We can hook a callback into this filter within a theme or plugin to return
all registered statuses—or just the specific ones needed. Let me know if
you think this approach would work for your use case.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64853#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list