Documentation Functions wpcom-caching.php wpcom_vip_get_term_by()

wpcom_vip_get_term_by

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.

Parameters

Name Type Description

$field

string

Either ’slug’, ’name’, or ’id’

$value

string or 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 or null or bool: Term Row from database in the type specified by $filter. Will return false if $taxonomy does not exist or $term was not found.