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

WordPress Trac noreply at wordpress.org
Tue Jan 8 17:32:18 UTC 2019


#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 spacedmonkey):

 Looking there function `term_exists` seems to be used by many many
 plugins, there is
 [https://wpdirectory.net/search/01D0Q7MV1M2H5JPTWJQZW442PK 2452]
 references in the plugin repo at time of writing. I feel like it is
 unlikely that we could ever get rid of it's use in the wild, as even
 jetpack and contact form 7 use it.

 I think that we should go ahead with using `get_terms`, but disable
 caching by default with a new param like `cached` on the term query class.
 I would also not suppress filters, meaning that,  if you want go in and
 turn on caching, you can do so at your own risk.

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


More information about the wp-trac mailing list