bb_get_forum_bread_crumb

The BuddyPress bb get forum bread crumb function.

Description

bb_get_forum_bread_crumb( (string) $args = '' ); 

Parameters (1)

0. $args — Optional. (string) => ''
The args.

Usage

  1. if ( !function_exists( 'bb_get_forum_bread_crumb' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; 
  3.  
  4. // The args. 
  5. $args = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_forum_bread_crumb($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_get_forum_bread_crumb($args = '') { 
  2. $defaults = array( 
  3. 'forum_id' => 0,  
  4. 'separator' => ' » ',  
  5. 'class' => null 
  6. ); 
  7. $args = wp_parse_args($args, $defaults); 
  8. extract($args, EXTR_SKIP); 
  9.  
  10. $trail = ''; 
  11. $trail_forum = bb_get_forum(get_forum_id($forum_id)); 
  12. if ($class) { 
  13. $class = ' class="' . $class . '"'; 
  14. $current_trail_forum_id = $trail_forum->forum_id; 
  15. while ( $trail_forum && $trail_forum->forum_id > 0 ) { 
  16. $crumb = $separator; 
  17. if ($current_trail_forum_id != $trail_forum->forum_id || !bb_is_forum()) { 
  18. $crumb .= '<a' . $class . ' href="' . get_forum_link($trail_forum->forum_id) . '">'; 
  19. } elseif ($class) { 
  20. $crumb .= '<span' . $class . '>'; 
  21. $crumb .= get_forum_name($trail_forum->forum_id); 
  22. if ($current_trail_forum_id != $trail_forum->forum_id || !bb_is_forum()) { 
  23. $crumb .= '</a>'; 
  24. } elseif ($class) { 
  25. $crumb .= '</span>'; 
  26. $trail = $crumb . $trail; 
  27. $trail_forum = bb_get_forum($trail_forum->forum_parent); 
  28.  
  29. return apply_filters('bb_get_forum_bread_crumb', $trail, $forum_id );