bb_get_tag_id

Bb_get_tag_id() - Returns the id of the specified or global tag.

Description

(int) bb_get_tag_id( (int) $id = 0 ); 

Returns (int)

Parameters (1)

0. $id — Optional. (int)
The TT_ID, tag name of the desired tag, or 0 for the global tag

Usage

  1. if ( !function_exists( 'bb_get_tag_id' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php'; 
  3.  
  4. // The TT_ID, tag name of the desired tag, or 0 for the global tag 
  5. $id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_tag_id($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_tag_id( $id = 0 ) { 
  2. global $tag; 
  3. if ( $id ) { 
  4. $_tag = bb_get_tag( $id ); 
  5. } else { 
  6. $_tag =& $tag; 
  7. return (int) $_tag->tag_id;