Cached version of get_term_by.

Many calls to get_term_by (with name or slug lookup) across on a single pageload can easily add up the query count. This function helps prevent that by adding a layer of caching.


Name Type Description
$field string Either 'slug', 'name', or 'id'
$value string|int Search for this term value
$taxonomy string Taxonomy Name
$output string Optional. Constant OBJECT, ARRAY_A, or ARRAY_N
$filter string Optional. Default is 'raw' or no WordPress defined filter will applied.

Return Value

mixed|null|bool: Term Row from database in the type specified by $filter. Will return false if $taxonomy does not exist or $term was not found.

Ready to get started?

Tell us about your needs

Let us lead the way. We’ll help you select a top tier development partner. We’ll train your developers, operations, infrastructure, and editorial teams. We’ll coarchitect your deployment processes. We will provide live support for peak events. We’ll help your people avoid dark alleys and blind corners, and reduce wasted cycles.