bb_get_public_tags

The BuddyPress bb get public tags function.

Description

bb_get_public_tags( $topic_id ); 

Parameters (1)

0. $topic_id
The topic id.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php  
  1. function bb_get_public_tags( $topic_id ) { 
  2. $tags = bb_get_topic_tags( $topic_id ); 
  3. if ( !is_array( $tags ) ) 
  4. return; 
  5. $used_tags = array(); 
  6. $public_tags = array(); 
  7.  
  8. foreach ( $tags as $tag ) : 
  9. if ( !in_array($tag->tag_id, $used_tags) ) : 
  10. $public_tags[] = $tag; 
  11. $used_tags[] = $tag->tag_id; 
  12. endif; 
  13. endforeach; 
  14. return $public_tags;