wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



is_taxonomy_hierarchical › WordPress Function

Od2.3.0
Przestarzałyn/a
is_taxonomy_hierarchical ( $taxonomy )
Parametry:
  • (string) $taxonomy Name of taxonomy object.
    Wymagane: Tak
Powrót:
  • (bool) Whether the taxonomy is hierarchical.
Zdefiniowane na:
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.


Źródło

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

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