Retrieves term description.
Parameters
$term
intoptional- Term ID. Defaults to the current term ID.
$deprecated
nulloptional- Deprecated. Not used.
Default:
null
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;
}
If you want to filter the description, don’t use this function, use
get_the_archive_description()
instead. This one doesapply_filters
before returning the description, and usesterm_description()
internally to retrieve the description when is for a term.Displays a description of the post tag ID 28.
The default usage returns the description of the current queried term.