bb_forum

The BuddyPress bb forum function.

Description

bb_forum(); 

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_forum() { // Returns current depth 
  2. global $bb_forums_loop; 
  3. if ( !is_object($bb_forums_loop) || !is_a($bb_forums_loop, 'BB_Loop') ) 
  4. return false; 
  5. if ( !is_array($bb_forums_loop->elements) ) 
  6. return false; 
  7.  
  8. if ( $bb_forums_loop->step() ) { 
  9. $GLOBALS['forum'] =& $bb_forums_loop->elements[key($bb_forums_loop->elements)]; // Globalize the current forum object 
  10. } else { 
  11. $bb_forums_loop->reinstate(); 
  12. return $bb_forums_loop = null; // All done? Kill the object and exit the loop. 
  13.  
  14. return $bb_forums_loop->walker->depth;