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.


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.

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.