[wp-trac] [WordPress Trac] #21760: get_term_by() calls are not cached
WordPress Trac
noreply at wordpress.org
Thu Sep 29 22:35:34 UTC 2016
#21760: get_term_by() calls are not cached
-------------------------------------------------+-------------------------
Reporter: wonderboymusic | Owner: ocean90
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.7
Component: Taxonomy | Version: 2.3
Severity: normal | Resolution: fixed
Keywords: has-patch needs-testing has-unit- | Focuses:
tests commit | performance
-------------------------------------------------+-------------------------
Changes (by ocean90):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"38677"]:
{{{
#!CommitTicketReference repository="" revision="38677"
Taxonomy: Use `WP_Term_Query` in `get_term_by()`.
`WP_Term_Query` already supports querying terms by 'slug', 'name', and
'term_taxonomy_id'. Its additional arguments allow us to generate nearly
the same SQL queries as before.
This change has one yuge benefit: the term queries are now cached.
Add tests to increase coverage of `get_term_by()`.
Props spacedmonkey, boonebgorges, johnjamesjacoby, pento, ocean90.
Fixes #21760.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/21760#comment:109>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list