WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/is taxonomy

← Return to function reference.


This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use any of these functions instead.

Contents

Description

This function is deprecated as of Version 3.0. Please use Function_Reference/is_tax instead.

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.

Usage

<?php is_taxonomy($taxonomy); ?>

Parameters

$taxonomy
(string) (required) The name of the taxonomy
Default: None

Return Values

(boolean) 
True on success, false on failure.

Examples

$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_taxonomy'] is not set

Notes

Change Log

Since: 2.3.0

Source File

is_taxonomy() is located in wp-includes/taxonomy.php.

Related

See also index of Function Reference and index of Template Tags.