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

1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
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

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.