taxonomy_exists

Checks that the taxonomy name exists.

Description

taxonomy_exists( (string) $taxonomy ); 

Formerly is_taxonomy(), introduced in 2.3.0.

Parameters (1)

0. $taxonomy (string)
Name of taxonomy object.

Usage

  1. if ( !function_exists( 'taxonomy_exists' ) ) { 
  2. require_once ABSPATH . WPINC . '/taxonomy.php'; 
  3.  
  4. // Name of taxonomy object. 
  5. $taxonomy = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = taxonomy_exists($taxonomy); 
  9.  

Defined (1)

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

/wp-includes/taxonomy.php  
  1. function taxonomy_exists( $taxonomy ) { 
  2. global $wp_taxonomies; 
  3.  
  4. return isset( $wp_taxonomies[$taxonomy] );