bp_messages_mark_notification_on_mark_thread( int $thread_id )

Mark new message notification as read when the corresponding message is mark read.

Description

This callback covers mark-as-read bulk actions.

Parameters

$thread_id

(int) (Required) ID of the thread being marked as read.

Source

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

function bp_messages_mark_notification_on_mark_thread( $thread_id ) {
	$thread_messages = BP_Messages_Thread::get_messages( $thread_id );

	foreach ( $thread_messages as $thread_message ) {
		bp_notifications_mark_notifications_by_item_id( bp_loggedin_user_id(), $thread_message->id, buddypress()->messages->id, 'new_message' );
	}
}

Changelog

Changelog
Version Description
BuddyPress 3.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.