WordPress at a glance

is_taxonomy_hierarchical() WP 1.0

Whether the taxonomy object is hierarchical.

Checks to make sure that the taxonomy is an object first. Then Gets the object, and finally returns the hierarchical value in the object.

A false return value might also mean that the taxonomy does not exist.

✈ 1 time = 0.000011s = very fast | 50000 times = 0.02s = speed of light PHP 7.0.8, WP 4.6.1

No Hooks.

Return

true/false. Whether the taxonomy is hierarchical.

Usage

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

Code of is_taxonomy_hierarchical: wp-includes/taxonomy.php VER 4.9.8

<?php
function is_taxonomy_hierarchical($taxonomy) {
	if ( ! taxonomy_exists($taxonomy) )
		return false;

	$taxonomy = get_taxonomy($taxonomy);
	return $taxonomy->hierarchical;
}

Related Functions

From tag: Conditional tags (all)

More from category: Any taxonomy

No comments
    Hello, !     Log In . Register