[wp-trac] [WordPress Trac] #63904: Add action hook when terms counts are updated

WordPress Trac noreply at wordpress.org
Mon Sep 1 12:09:50 UTC 2025


#63904: Add action hook when terms counts are updated
------------------------------+-----------------------------
 Reporter:  LeonidasMilossis  |       Owner:  SergeyBiryukov
     Type:  enhancement       |      Status:  accepted
 Priority:  normal            |   Milestone:  6.9
Component:  Taxonomy          |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  needs-patch       |     Focuses:  performance
------------------------------+-----------------------------
Changes (by rollybueno):

 * keywords:   => needs-patch


Comment:

 IMO, I think the best place for a dedicated hook should be inside
 `wp_update_term_count_now()` -
 https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/taxonomy.php#L3579, right after the taxonomy’s
 `update_count_callback` runs and.. just before the caches are cleared.

 Why? because this is where the hook should only fires when a real recount
 has actually happened, and not on every status change or autosave.

 I might be wrong but any input is very much welcome...

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63904#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list