Codex

Function Reference/is taxonomy

Contents

Description

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.

Usage

<?php is_taxonomy($taxonomy); ?>

Example

$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


Parameters

taxonomy

(string)The name of the taxonomy.

This page is marked as incomplete. You can help Codex by expanding it.