A WordPress-centric search engine for devs and theme authors



term_description ›

Since2.8.0
Deprecatedn/a
term_description ( $term = 0, $deprecated = null )
Parameters: (2)
  • (int) $term Optional. Term ID. Will use global term ID by default.
    Required: No
    Default:
  • (null) $deprecated Deprecated argument.
    Required: No
    Default: null
Returns:
  • (string) Term description, available.
Defined at:
Codex:
Change Log:
  • 4.9.2

Retrieve term description.



Source

function term_description( $term = 0, $deprecated = null ) {
	if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) {
		$term = get_queried_object();
		if ( $term ) {
			$term = $term->term_id;
		}
	}
	$description = get_term_field( 'description', $term );
	return is_wp_error( $description ) ? '' : $description;
}