[wp-trac] [WordPress Trac] #21760: get_term_by() calls are not cached

WordPress Trac noreply at wordpress.org
Sat Mar 11 02:26:13 UTC 2017


#21760: get_term_by() calls are not cached
-------------------------------------------------+-------------------------
 Reporter:  wonderboymusic                       |       Owner:  ocean90
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  4.8
Component:  Taxonomy                             |     Version:  2.3
 Severity:  major                                |  Resolution:
 Keywords:  has-patch needs-refresh needs-unit-  |     Focuses:
  tests                                          |  performance
-------------------------------------------------+-------------------------

Comment (by boonebgorges):

 In [changeset:"40275"]:
 {{{
 #!CommitTicketReference repository="" revision="40275"
 Don't run 'get_terms' filter when querying for terms within
 `get_term_by()`.

 Historically, it has been possible to call `get_term_by()` within
 a 'get_terms' filter callback. Since `get_term_by()` was refactored
 to use `get_terms()` internally [38677], callbacks of this nature
 have resulted in infinite loops.

 As a workaround, we introduce a 'suppress_filter' option to `get_terms()`,
 and use it when calling the function from within `get_term_by()`.

 Props ocean90.
 See #21760.
 }}}

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


More information about the wp-trac mailing list