messages_get_message_thread_id( int $message_id )

Get the thread ID from a message ID.


Parameters Parameters

$message_id

(int) (Required) ID of the message.


Top ↑

Return Return

(int) The ID of the thread if found, otherwise 0.


Source Source

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

function messages_get_message_thread_id( $message_id = 0 ) {
	global $wpdb;

	$bp = buddypress();

	return (int) $wpdb->get_var( $wpdb->prepare( "SELECT thread_id FROM {$bp->messages->table_name_messages} WHERE id = %d", $message_id ) );
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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