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
if ( !function_exists( 'bb_get_public_tags' ) ) { require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php'; } // The topic id. $topic_id = null; // NOTICE! Understand what this does before running. $result = bb_get_public_tags($topic_id);
Defined (1)
The function is defined in the following location(s).
- /bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php
- function bb_get_public_tags( $topic_id ) {
- $tags = bb_get_topic_tags( $topic_id );
- if ( !is_array( $tags ) )
- return;
- $used_tags = array();
- $public_tags = array();
- foreach ( $tags as $tag ) :
- if ( !in_array($tag->tag_id, $used_tags) ) :
- $public_tags[] = $tag;
- $used_tags[] = $tag->tag_id;
- endif;
- endforeach;
- return $public_tags;
- }