bp_activity_remove_screen_notifications( int $user_id )

Mark at-mention notifications as read when users visit their Mentions page.


Description Description


Parameters Parameters

$user_id

(Required) The id of the user whose notifications are marked as read.


Top ↑

Source Source

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

function bp_activity_remove_screen_notifications( $user_id = 0 ) {
	// Only mark read if the current user is looking at his own mentions.
	if ( empty( $user_id ) || (int) $user_id !== (int) bp_loggedin_user_id() ) {
		return;
	}

	bp_notifications_mark_notifications_by_type( $user_id, buddypress()->activity->id, 'new_at_mention' );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.5.0 Add the $user_id parameter
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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