bbp_forum_post_count

Output total post count of a forum.

Description

bbp_forum_post_count( (int) $forum_id = 0, (constant) $total_count = true, (bool) $integer = false ); 

Parameters (3)

0. $forum_id — Optional. (int)
Forum id
1. $total_count — Optional. (constant) => true
To get the total count or normal count?
2. $integer — Optional. (bool) => false
Whether or not to format the result

Usage

  1. if ( !function_exists( 'bbp_forum_post_count' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/forums/template.php'; 
  3.  
  4. // Optional. Forum id 
  5. $forum_id = -1; 
  6.  
  7. // Optional. To get the total count or normal count? 
  8. $total_count = true; 
  9.  
  10. // Optional. Whether or not to format the result 
  11. $integer = false; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bbp_forum_post_count($forum_id, $total_count, $integer); 
  15.  

Defined (1)

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

/includes/forums/template.php  
  1. function bbp_forum_post_count( $forum_id = 0, $total_count = true, $integer = false ) { 
  2. echo bbp_get_forum_post_count( $forum_id, $total_count, $integer );