term_description() WP 1.0
Retrieve term description.
Works based on: get_term_field()
No Hooks.
Return
String. Term description, if available.
Usage
term_description( $term, $deprecated );
- $term(int)
- Term ID.
Default: current term ID - $deprecated(null)
- Deprecated. Not used.
Default: null
Changelog
Since 2.8.0 | Introduced. |
Since 4.9.2 | The $taxonomy parameter was deprecated. |
Code of term_description() term description WP 5.6
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;
}Related Functions
From tag: Description (of post term)
More from category: Any taxonomy
- edit_term_link()
- get_edit_term_link()
- get_taxonomies()
- get_taxonomy()
- get_term()
- get_term_by()
- get_term_children()
- get_term_field()
- get_term_link()