bbp_decrease_topic_reply_count( int $topic_id )
Decrease the total reply count of a topic by one.
Description Description
Parameters Parameters
- $topic_id
-
(Required) The topic id.
Return Return
(void)
Source Source
File: includes/topics/functions.php
function bbp_decrease_topic_reply_count( $topic_id = 0 ) {
// Bail early if no id is passed.
if ( empty( $topic_id ) ) {
return;
}
// If it's a reply, get the topic id.
if ( bbp_is_reply( $topic_id ) ) {
$reply_id = $topic_id;
$topic_id = bbp_get_reply_topic_id( $reply_id );
// Update inverse based on item status
if ( ! bbp_is_reply_public( $reply_id ) ) {
bbp_decrease_topic_reply_count_hidden( $topic_id );
return;
}
}
// Bump down
bbp_bump_topic_reply_count( $topic_id, -1 );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |