BP_Messages_Thread::is_valid( int $thread_id )

Checks whether a message thread exists.


Parameters Parameters

$thread_id

(int) (Required) The message thread ID.


Top ↑

Return Return

(false|int|null) The message thread ID on success, null on failure.


Source Source

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

	public static function is_valid( $thread_id = 0 ) {

		// Bail if no thread ID is passed.
		if ( empty( $thread_id ) ) {
			return false;
		}

		$thread = self::get_messages( $thread_id );

		if ( ! empty( $thread ) ) {
			return $thread_id;
		} else {
			return null;
		}
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.