is_term

Check if Term exists.

Description

is_term( (int|string) $term, (string) $taxonomy = '', (int) $parent = 0 ); 

Parameters (3)

0. $term (int|string)
The term to check
1. $taxonomy — Optional. (string) => ''
The taxonomy name to use
2. $parent — Optional. (int)
ID of parent term under which to confine the exists search.

Usage

  1. if ( !function_exists( 'is_term' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The term to check 
  5. $term = null; 
  6.  
  7. // The taxonomy name to use 
  8. $taxonomy = ''; 
  9.  
  10. // ID of parent term under which to confine the exists search. 
  11. $parent = -1; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = is_term($term, $taxonomy, $parent); 
  15.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function is_term( $term, $taxonomy = '', $parent = 0 ) { 
  2. _deprecated_function( __FUNCTION__, '3.0.0', 'term_exists()' ); 
  3. return term_exists( $term, $taxonomy, $parent );