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



wp_get_term_taxonomy_parent_id › WordPress Function

Depuis3.1.0
Dépréciéen/a
wp_get_term_taxonomy_parent_id ( $term_id, $taxonomy )
Paramètres: (2)
  • (int) $term_id Term ID.
    Requis: Oui
  • (string) $taxonomy Taxonomy name.
    Requis: Oui
Retourne:
  • (int|false) Parent term ID on success, false on failure.
Défini(e) dans:
Codex:

Returns the term's parent's term ID.



Source

function wp_get_term_taxonomy_parent_id( $term_id, $taxonomy ) {
	$term = get_term( $term_id, $taxonomy );
	if ( ! $term || is_wp_error( $term ) ) {
		return false;
	}
	return (int) $term->parent;
}