bbp_get_topic_tag_description

Return the description of the current tag.

Description

(string) bbp_get_topic_tag_description( (array) $args = array() ); 

Returns (string)

Term Name

Parameters (1)

0. $args — Optional. (array) => array()
Before|after|tag

Usage

  1. if ( !function_exists( 'bbp_get_topic_tag_description' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/topics/template.php'; 
  3.  
  4. // before|after|tag 
  5. $args = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_get_topic_tag_description($args); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/topics/template.php  
  1. function bbp_get_topic_tag_description( $args = array() ) { 
  2.  
  3. // Parse arguments against default values 
  4. $r = bbp_parse_args( $args, array( 
  5. 'before' => '<div class="bbp-topic-tag-description"><p>',  
  6. 'after' => '</p></div>',  
  7. 'tag' => '' 
  8. ), 'get_topic_tag_description' ); 
  9.  
  10. // Get the term 
  11. if ( ! empty( $r['tag'] ) ) { 
  12. $term = get_term_by( 'slug', $r['tag'], bbp_get_topic_tag_tax_id() ); 
  13. } else { 
  14. $tag = get_query_var( 'term' ); 
  15. $r['tag'] = $tag; 
  16. $term = get_queried_object(); 
  17.  
  18. // Add before and after if description exists 
  19. if ( !empty( $term->description ) ) { 
  20. $retval = $r['before'] . $term->description . $r['after']; 
  21.  
  22. // No description, no HTML 
  23. } else { 
  24. $retval = ''; 
  25.  
  26. return apply_filters( 'bbp_get_topic_tag_description', $retval, $r );