Languages: English • Italiano • 日本語 (Add your language)
This Conditional Tag checks if the taxonomy name exists by passing a taxonomy name as an argument to it. This is a boolean function uses a global $wp_taxonomies variable for checking if taxonomy name existence, meaning it returns either TRUE if the taxonomy name exist or FALSE if it doesn't exist.
<?php taxonomy_exists($taxonomy); ?>
$taxonomy_exist = taxonomy_exists('category'); //returns true $taxonomy_exist = taxonomy_exists('post_tag'); //returns true $taxonomy_exist = taxonomy_exists('link_category'); //returns true $taxonomy_exist = taxonomy_exists('my_taxonomy'); //returns false if global $wp_taxonomies['my_taxonomy'] is not set
Since: 3.0
taxonomy_exists() is located in wp-includes/taxonomy.php
.