[wp-trac] [WordPress Trac] #38280: Make term count for a specific object type available

WordPress Trac noreply at wordpress.org
Mon Jun 18 05:15:25 UTC 2018


#38280: Make term count for a specific object type available
--------------------------------------+------------------------------
 Reporter:  desrosj                   |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Taxonomy                  |     Version:  4.7
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by ivankristianto):

 @boonebgorges
 I think it's a good idea to bail it early and also the safest.

 And I found a potential issue, if the taxonomy has custom
 {{{update_count_callback}}} , the {{{_update_post_term_count()}}} will
 never get called. Thus function {{{wp_get_term_count_for_object_type()}}}
 will never return the correct count.

 I propose to move the logic to count terms per object types from
 {{{_update_post_term_count}}} into reusable function and call it from
 {{{wp_update_term_count_now}}} instead.

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


More information about the wp-trac mailing list