bbp_bump_topic_reply_count_hidden( int $topic_id, int $difference = 1 )

Bump the total hidden reply count of a topic


Description Description


Parameters Parameters

$topic_id

(Optional) Topic id.

$difference

(Optional) Default 1

Default value: 1


Top ↑

Return Return

(int) Topic hidden reply count


Top ↑

Source Source

File: includes/topics/functions.php

function bbp_bump_topic_reply_count_hidden( $topic_id = 0, $difference = 1 ) {

	// Bail if no bump
	if ( empty( $difference ) ) {
		return false;
	}

	// Get counts
	$topic_id    = bbp_get_topic_id( $topic_id );
	$reply_count = bbp_get_topic_reply_count_hidden( $topic_id, true );
	$difference  = (int) $difference;
	$new_count   = (int) ( $reply_count + $difference );

	// Update this topic id's hidden reply count
	update_post_meta( $topic_id, '_bbp_reply_count_hidden', $new_count );

	// Filter & return
	return (int) apply_filters( 'bbp_bump_topic_reply_count_hidden', $new_count, $topic_id, $difference );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.