Advertisements

term_description

Definition:
function term_description( $term = 0, $taxonomy = 'post_tag' ) {}

Retrieve term description.

Parameters

  • int $term: Optional. Term ID. Will use global term ID by default.
  • $taxonomy

Return values

returns:Term description, available.

Source code

function term_description( $term = 0, $taxonomy = 'post_tag' ) {

	if ( !$term && ( is_tax() || is_tag() || is_category() ) ) {

		$term = get_queried_object();

		$taxonomy = $term->taxonomy;

		$term = $term->term_id;

	}

	$description = get_term_field( 'description', $term, $taxonomy );

	return is_wp_error( $description ) ? '' : $description;

}

2939

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: