WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/is term


This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use any of these functions instead.

Description

Check if Term exists.

Returns the index of a defined term, or 0 (false) if the term doesn't exist.

Replace With

term_exists for check that term exists or is_tax with optional $term argument for check that you are in term archive.

Usage

<?php is_term$term$taxonomy ?>

Parameters

$term
(integer|string) (required) The term to check
Default: None
$taxonomy
(string) (optional) The taxonomy name to use
Default: ''

Return Values

(mixed) 
Get the term id or Term Object, if exists.

Examples

Notes

  • Uses global: (object) $wpdb
  • Uses global: (object) $term

Change Log

Source File

is_term() is located in wp-includes/taxonomy.php.

Related

See also index of Function Reference and index of Template Tags.