bbp_get_forum_post_count( int $forum_id, bool $total_count = true, boolean $integer = false )
Return total post count of a forum
Description Description
Parameters Parameters
- $forum_id
-
(Optional) Forum id
- $total_count
-
(Optional) To get the total count or normal count?
Default value: true
- $integer
-
(Optional) Whether or not to format the result
Default value: false
Return Return
(int) Forum post count
Source Source
File: includes/forums/template.php
function bbp_get_forum_post_count( $forum_id = 0, $total_count = true, $integer = false ) { $forum_id = bbp_get_forum_id( $forum_id ); $topics = bbp_get_forum_topic_count( $forum_id, $total_count, true ); $replies = bbp_get_forum_reply_count( $forum_id, $total_count, true ); $retval = ( $replies + $topics ); $filter = ( true === $integer ) ? 'bbp_get_forum_post_count_int' : 'bbp_get_forum_post_count'; return apply_filters( $filter, $retval, $forum_id ); }
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |