is_taxonomy_hierarchical( string $taxonomy )

Determines whether the taxonomy object is hierarchical.


Description Description

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.

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


Parameters Parameters

$taxonomy

(string) (Required) Name of taxonomy object.


Top ↑

Return Return

(bool) Whether the taxonomy is hierarchical.


Top ↑

Source Source

File: wp-includes/taxonomy.php

function is_taxonomy_hierarchical( $taxonomy ) {
	if ( ! taxonomy_exists( $taxonomy ) ) {
		return false;
	}

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

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.