wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_get_term_taxonomy_parent_id › WordPress Function

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) Parent term ID on success, false on failure.
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;
}