bbp_is_forum_category

Is the forum a category?.

Description

bbp_is_forum_category( (int) $forum_id = 0 ); 

Parameters (1)

0. $forum_id — Optional. (int)
Forum id

Usage

  1. if ( !function_exists( 'bbp_is_forum_category' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/forums/template.php'; 
  3.  
  4. // Optional. Forum id 
  5. $forum_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_is_forum_category($forum_id); 
  9.  

Defined (1)

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

/includes/forums/template.php  
  1. function bbp_is_forum_category( $forum_id = 0 ) { 
  2. $forum_id = bbp_get_forum_id( $forum_id ); 
  3. $type = bbp_get_forum_type( $forum_id ); 
  4. $retval = ( !empty( $type ) && 'category' === $type ); 
  5.  
  6. return (bool) apply_filters( 'bbp_is_forum_category', (bool) $retval, $forum_id );