bbp_decrease_forum_topic_count( int $forum_id )
Decrease the total topic count of a forum by one.
Description Description
Parameters Parameters
- $forum_id
-
(Required) The forum id.
Return Return
(void)
Source Source
File: includes/forums/functions.php
function bbp_decrease_forum_topic_count( $forum_id = 0 ) {
// Bail early if no id is passed.
if ( empty( $forum_id ) ) {
return;
}
// If it's a topic, get the forum id.
if ( bbp_is_topic( $forum_id ) ) {
$topic_id = $forum_id;
$forum_id = bbp_get_topic_forum_id( $topic_id );
// Update inverse based on item status
if ( ! bbp_is_topic_public( $topic_id ) ) {
bbp_decrease_forum_topic_count_hidden( $forum_id );
return;
}
}
// Bump down
bbp_bump_forum_topic_count( $forum_id, -1 );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |