Codex tools: Log in / create account
Contents |
The is_taxonomy function checks if the taxonomy name exists by passing a taxonomy name as an argument to it. This function uses a global $wp_taxonomies variable for checking if taxonomy name existence. It returns boolean true if the taxonomy name exist, otherwise false.
<?php is_taxonomy($taxonomy); ?>
$taxonomy_exist = is_taxonomy('category'); //returns true $taxonomy_exist = is_taxonomy('post_tag'); //returns true $taxonomy_exist = is_taxonomy('link_category'); //returns true $taxonomy_exist = is_taxonomy('my_taxonomy'); //returns false if global $wp_taxonomies['my_category'] is not set
taxonomy
(string)The name of the taxonomy.
This page is marked as incomplete. You can help Codex by expanding it.