wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



is_taxonomy_hierarchical › WordPress Function

Depuis2.3.0
Dépréciéen/a
is_taxonomy_hierarchical ( $taxonomy )
Paramètres:
  • (string) $taxonomy Name of taxonomy object.
    Requis: Oui
Retourne:
  • (bool) Whether the taxonomy is hierarchical.
Défini(e) dans:
Codex:

Determines 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. For more information on this and similar theme functions, check out the {@link Conditional Tags} article in the Theme Developer Handbook.


Source

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

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