BP_REST_Forums_Endpoint::get_forum_last_active_time( int $forum_id )

Last active time for forum.

Description

Parameters

$forum_id

(int) (Required) ID of the forum.

Return

(string)

Source

File: bp-forums/classes/class-bp-rest-forums-endpoint.php

	public function get_forum_last_active_time( $forum_id ) {
		$last_active = get_post_meta( $forum_id, '_bbp_last_active_time', true );
		if ( empty( $last_active ) ) {
			$reply_id = bbp_get_forum_last_reply_id( $forum_id );
			if ( ! empty( $reply_id ) ) {
				$last_active = get_post_field( 'post_date', $reply_id );
			} else {
				$topic_id = bbp_get_forum_last_topic_id( $forum_id );
				if ( ! empty( $topic_id ) ) {
					$last_active = $this->bbp_rest_get_topic_last_active_time( $topic_id );
				} else {
					$last_active = get_post_field( 'post_date', $forum_id );
				}
			}
		}

		return get_gmt_from_date( $last_active );
	}

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.