is_taxonomy_hierarchical() – Determines whether the taxonomy object is hierarchical.

You appear to be a bot. Output may be restricted

Description

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 https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.

Usage

$bool = is_taxonomy_hierarchical( $taxonomy );

Parameters

$taxonomy
( string ) required – Name of taxonomy object.

Returns

bool Whether the taxonomy is hierarchical.

Source

File name: wordpress/wp-includes/taxonomy.php
Lines:

1 to 8 of 8
function is_taxonomy_hierarchical( $taxonomy ) {
  if ( ! taxonomy_exists( $taxonomy ) ) {
    return false;
  }

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

 View on GitHub View on Trac