A WordPress-centric search engine for devs and theme authors



wp_get_term_taxonomy_parent_id ›

Since3.1.0
Deprecatedn/a
wp_get_term_taxonomy_parent_id ( $term_id, $taxonomy )
Parameters: (2)
  • (int) $term_id Term ID.
    Required: Yes
  • (string) $taxonomy Taxonomy name.
    Required: Yes
Returns:
  • (int|false) False on error.
Defined at:
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;
}