bbp_move_reply_count( int $move_reply_id, int $source_topic_id, int $destination_topic_id )

Fix counts on reply move

Description

When a reply is moved, update the counts of source and destination topic and their forums.

Parameters

$move_reply_id

(Required) Move reply id

$source_topic_id

(Required) Source topic id

$destination_topic_id

(Required) Destination topic id

Source

File: bp-forums/replies/functions.php

1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
function bbp_move_reply_count( $move_reply_id, $source_topic_id, $destination_topic_id ) {
 
    // Forum topic counts
    bbp_update_forum_topic_count( bbp_get_topic_forum_id( $destination_topic_id ) );
 
    // Forum reply counts
    bbp_update_forum_reply_count( bbp_get_topic_forum_id( $destination_topic_id ) );
 
    // Topic reply counts
    bbp_update_topic_reply_count( $source_topic_id      );
    bbp_update_topic_reply_count( $destination_topic_id );
 
    // Topic hidden reply counts
    bbp_update_topic_reply_count_hidden( $source_topic_id      );
    bbp_update_topic_reply_count_hidden( $destination_topic_id );
 
    // Topic voice counts
    bbp_update_topic_voice_count( $source_topic_id      );
    bbp_update_topic_voice_count( $destination_topic_id );
 
    do_action( 'bbp_move_reply_count', $move_reply_id, $source_topic_id, $destination_topic_id );
}

Changelog

Changelog
Version Description
bbPress (r4521) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.