[wp-trac] [WordPress Trac] #36949: Term exists should use get_terms internally

WordPress Trac noreply at wordpress.org
Mon Mar 30 16:14:26 UTC 2020


#36949: Term exists should use get_terms internally
--------------------------------------------+-----------------------------
 Reporter:  spacedmonkey                    |       Owner:  (none)
     Type:  enhancement                     |      Status:  new
 Priority:  normal                          |   Milestone:  Future Release
Component:  Taxonomy                        |     Version:  2.3
 Severity:  normal                          |  Resolution:
 Keywords:  has-patch has-unit-tests close  |     Focuses:  performance
--------------------------------------------+-----------------------------

Comment (by boonebgorges):

 @spacedmonkey Thanks for continuing to plug away at the ticket. I have
 reviewed the patch and the `cached_results` trick seems like it will
 probably work, though I must say I'm not thrilled about the ideal of
 giving developers the ability to bypass the cache on a case basis.

 More generally, I worry that this change is going to introduce strange
 bugs that are difficult to trace for third-party tools that are using
 `term_exists()` in a way that expects it to be uncached and unfiltered.
 Think, for example, of plugins that filter various parts of
 `WP_Term_Query` - say, to exclude certain terms from being viewed
 publicly. Currently, these filters do not apply to `term_exists()`, but if
 they suddenly are, I can imagine it causing problems in various ways.

 For this reason, I continue to think that this change is unwise. As above
 https://core.trac.wordpress.org/ticket/36949#comment:9, a better way to
 consolidate and improve maintainability is to reduce the use of
 `term_exists()` throughout WP.

 If another team member thinks that @spacedmonkey is right and I'm wrong,
 I'd be OK with being outvoted. But then I want those other team members to
 take responsibility for shepherding the change and cleaning up the (IMO
 inevitable) compatibility breaks that are reported afterward.

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


More information about the wp-trac mailing list