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

(int) (Required) Move reply id

$source_topic_id

(int) (Required) Source topic id

$destination_topic_id

(int) (Required) Destination topic id

Source

File: bp-forums/replies/functions.php

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.