bb_get_forum_class_names

The WordPress Core bb get forum class names function.

Description

bb_get_forum_class_names( (null) $args = null ); 

Parameters (1)

0. $args — Optional. (null) => null
The args.

Usage

  1. if ( !function_exists( 'bb_get_forum_class_names' ) ) { 
  2. require_once '/bp-forums/bbpress/bb-includes/functions.bb-template.php'; 
  3.  
  4. // The args. 
  5. $args = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_forum_class_names($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_class_names( $args = null ) { 
  2. if ( is_numeric( $args ) ) { // Not used 
  3. $args = array( 'id' => $args ); 
  4. } elseif ( $args && is_string( $args ) && false === strpos( $args, '=' ) ) { 
  5. $args = array( 'class' => $args ); 
  6. $defaults = array( 'id' => 0, 'key' => 'forum', 'class' => '', 'output' => 'string' ); 
  7. $args = wp_parse_args( $args, $defaults ); 
  8.  
  9. $classes = array(); 
  10. if ( $args['class'] ) { 
  11. $classes[] = $args['class']; 
  12.  
  13. global $bb_forums_loop; 
  14. if ( is_object( $bb_forums_loop ) && is_a( $bb_forums_loop, 'BB_Loop' ) ) { 
  15. $classes = array_merge( $classes, $bb_forums_loop->classes( 'array' ) ); 
  16.  
  17. if ( $args['output'] === 'string' ) { 
  18. $classes = join( ' ', $classes ); 
  19.  
  20. return apply_filters( 'bb_get_forum_class', $classes, $args );