WordPress at a glance

taxonomy_exists() WP 1.0

Checks that the taxonomy name exists.

Formerly is_taxonomy(), introduced in 2.3.0.

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.

Is the basis for: is_taxonomy_hierarchical()
✈ 1 time = 0.00001s = speed of light | 50000 times = 0.02s = speed of light | PHP 7.0.14, WP 4.7

No Hooks.

Return

true/false. Whether the taxonomy exists.

Usage

taxonomy_exists( $taxonomy );
$taxonomy(string) (required)
Name of taxonomy object.

Notes

  • Global. Array. $wp_taxonomies The registered taxonomies.

Changelog

Since 3.0.0 Introduced.

Code of taxonomy exists: wp-includes/taxonomy.php WP 5.2.2

<?php
function taxonomy_exists( $taxonomy ) {
	global $wp_taxonomies;

	return isset( $wp_taxonomies[ $taxonomy ] );
}

Related Functions

From tag: Conditional tags (all)

More from category: Any taxonomy

No comments
    Hello, !     Log In . Register