bp_messages_is_message_starred( int $mid, int $user_id )

Function to determine if a message ID is starred.


Parameters Parameters

$mid

(int) (Required) The message ID. Please note that this isn't the message thread ID.

$user_id

(int) (Required) The user ID.


Top ↑

Return Return

(bool)


Source Source

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

function bp_messages_is_message_starred( $mid = 0, $user_id = 0 ) {
	if ( empty( $user_id ) ) {
		$user_id = bp_displayed_user_id();
	}

	if ( empty( $mid ) ) {
		return false;
	}

	$starred = array_flip( (array) bp_messages_get_meta( $mid, 'starred_by_user', false ) );

	if ( isset( $starred[$user_id] ) ) {
		return true;
	} else {
		return false;
	}
}


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.