bb_list_tags

The BuddyPress bb list tags function.

Description

bb_list_tags( (null) $args = null ); 

Parameters (1)

0. $args — Optional. (null) => null
The args.

Usage

  1. if ( !function_exists( 'bb_list_tags' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; 
  3.  
  4. // The args. 
  5. $args = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_list_tags($args); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_list_tags( $args = null ) 
  2. $defaults = array( 
  3. 'tags' => false,  
  4. 'format' => 'list',  
  5. 'topic' => 0,  
  6. 'list_id' => 'tags-list' 
  7. ); 
  8.  
  9. $args = wp_parse_args( $args, $defaults ); 
  10. extract( $args, EXTR_SKIP ); 
  11.  
  12. if ( !$topic = get_topic( get_topic_id( $topic ) ) ) { 
  13. return false; 
  14.  
  15. if ( !is_array( $tags ) ) { 
  16. $tags = bb_get_topic_tags( $topic->topic_id ); 
  17.  
  18. if ( !$tags ) { 
  19. return false; 
  20.  
  21. $list_id = esc_attr( $list_id ); 
  22.  
  23. $r = ''; 
  24. switch ( strtolower( $format ) ) { 
  25. case 'table' : 
  26. break; 
  27.  
  28. case 'list' : 
  29. default : 
  30. $args['format'] = 'list'; 
  31. $r .= '<ul id="' . $list_id . '" class="tags-list list:tag">' . "\n"; 
  32. foreach ( $tags as $tag ) { 
  33. $r .= _bb_list_tag_item( $tag, $args ); 
  34. $r .= '</ul>'; 
  35. break; 
  36.  
  37. echo $r;