BP_REST_Forums_Endpoint::get_forum_last_active_author_id( int $forum_id )

Last active author for the forum.

Description

Parameters

$forum_id

(int) (Required) ID of the forum.

Return

(int)

Source

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

	public function get_forum_last_active_author_id( $forum_id ) {

		if ( empty( $forum_id ) ) {
			return 0;
		}

		$last_id = get_post_meta( $forum_id, '_bbp_last_active_id', true );
		if ( ! empty( $last_id ) ) {
			$post = get_post( $last_id );

			return ( ! empty( $post ) && ! empty( $post->post_author ) ) ? $post->post_author : 0;
		}

		return 0;
	}

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.