Cached version of term_exists()
Term exists calls can pile up on a single pageload. This function adds a layer of caching to prevent lots of queries.
Parameters
Name | Type | Description |
---|---|---|
$term | int|string | The term to check can be id, slug or name. |
$taxonomy | string | The taxonomy name to use |
$parent | int | Optional. ID of parent term under which to confine the exists search. |
Return Value
mixed: Returns null if the term does not exist. Returns the term ID if no taxonomy is specified and the term ID exists. Returns an array of the term ID and the term taxonomy ID the taxonomy is specified and the pairing exists.