Paramètre

$taxonomy(string)requis

Nom de l'objet de la taxonomie.

Description / Informations supplémentaires

Vérifie d'abord que la taxonomie existe, obtient l'objet de celle-ci puis retourne la valeur du champ 'hierarchical' de l'objet.

Retourne

(bool) True si la taxonomie est hiérarchique.

Déclaration et structure de la fonction is_taxonomy_hierarchical()

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

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

Détermine si un nom de taxonomie existe.

get_taxonomy()

Retourne l'objet d'une taxonomie en donnant son nom.

Où est utilisée la fonction is_taxonomy_hierarchical() dans le CMS WordPress

Sources

Codex WordPress : is_taxonomy_hierarchical()

Autres fonctions dans le même fichier : wp-includes/taxonomy.php

Retour