function wp_get_term_taxonomy_parent_id( $term_id, $taxonomy ) {}

Returns the term’s parent’s term_ID


  • int $term_id
  • string $taxonomy

Return values

returns:false on error

Source code

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;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: