bbp_get_topic_tag_description( array $args = array() )
Return the description of the current tag
Description Description
Parameters Parameters
- $args
-
(Optional) before|after|tag
Default value: array()
Return Return
(string) Term Name
Source Source
File: includes/topics/template.php
function bbp_get_topic_tag_description( $args = array() ) {
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'before' => '<div class="bbp-topic-tag-description"><p>',
'after' => '</p></div>',
'tag' => ''
), 'get_topic_tag_description' );
// Get the term
if ( ! empty( $r['tag'] ) ) {
$term = get_term_by( 'slug', $r['tag'], bbp_get_topic_tag_tax_id() );
} else {
$tag = $r['tag'] = get_query_var( 'term' );
$term = get_queried_object();
}
// Add before & after if description exists
$retval = ! empty( $term->description )
? $r['before'] . $term->description . $r['after']
: '';
// Filter & return
return apply_filters( 'bbp_get_topic_tag_description', $retval, $r, $args, $tag, $term );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |