BP_Messages_Thread::is_valid( int $thread_id )
Checks whether a message thread exists.
Description
Parameters
- $thread_id
-
(Required) The message thread ID.
Return
(false|int|null) The message thread ID on success, null on failure.
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; } }
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.