bbp_update_forum_last_active_time( int $forum_id, string $new_time = '' )

Update the forums last active date/time (aka freshness)

Description

Parameters

$forum_id

(int) (Optional) Topic id

$new_time

(string) (Optional) New time in mysql format

Default value: ''

Return

(bool) True on success, false on failure

Source

File: bp-forums/forums/functions.php

function bbp_update_forum_last_active_time( $forum_id = 0, $new_time = '' ) {
	$forum_id = bbp_get_forum_id( $forum_id );

	// Check time and use current if empty
	if ( empty( $new_time ) )
		$new_time = get_post_field( 'post_date', bbp_get_forum_last_active_id( $forum_id ) );

	// Update only if there is a time
	if ( !empty( $new_time ) )
		update_post_meta( $forum_id, '_bbp_last_active_time', $new_time );

	return (int) apply_filters( 'bbp_update_forum_last_active', $new_time, $forum_id );
}

Changelog

Changelog
Version Description
bbPress (r2680) 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.