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

WordPress Trac noreply at wordpress.org
Fri Jun 15 11:50:32 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 boonebgorges):

 @ivankristianto Good call, thanks!

 The failing test is because `_update_post_term_count()` now calls
 `get_term_meta()`, which populates the (entire) term meta cache for each
 term. I don't think this is a bug, but it means that the test needs some
 additional logic to ensure an empty termmeta cache before running its
 assertion. I've made the change in [attachment:38280.12.diff].

 I also swapped out your database query with `get_term_by(
 'term_taxonomy_id' )`, and changed the variable names to make it clear
 where you're referencing a term_taxonomy_id vs a term object/term_id.

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


More information about the wp-trac mailing list