Advertisements

wp_get_term_taxonomy_parent_id

Definition:
function wp_get_term_taxonomy_parent_id( $term_id, $taxonomy ) {}

Returns the term’s parent’s term_ID

Parameters

  • 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;

}

10783

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: