BP_Messages_Thread::prepare_last_message_status( int $thread_id )

Check if the thread contains any deleted recipients and it’s last active message

Description

Parameters

$thread_id

(int) (Required)

Source

File: bp-messages/classes/class-bp-messages-thread.php

	public static function prepare_last_message_status( $thread_id ) {
		global $wpdb;

		$recipients = static::get_recipients_for_thread( $thread_id );

		$deleted_recipients = array_filter($recipients, function( $recipient ) {
			return $recipient->is_deleted;
		});

		return [
			'thread_id'          => $thread_id,
			'deleted_recipients' => $deleted_recipients,
			'last_message'       => static::get_last_message( $thread_id )
		];
	}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 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.