messages_check_thread_access( int $thread_id, int $user_id )

Check whether a user has access to a thread.

Description

Parameters

$thread_id

(int) (Required) ID of the thread.

$user_id

(int) (Optional) ID of the user. Default: ID of the logged-in user.

Return

(int|null) Message ID if the user has access, otherwise null.

Source

File: bp-messages/bp-messages-functions.php

function messages_check_thread_access( $thread_id, $user_id = 0 ) {
	return BP_Messages_Thread::check_access( $thread_id, $user_id );
}

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.