bp_activity_remove_screen_notifications( int $user_id )
Mark at-mention notifications as read when users visit their Mentions page.
Description
Parameters
- $user_id
-
(Required) The id of the user whose notifications are marked as read.
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' ); }
Changelog
Version | Description |
---|---|
BuddyPress 2.5.0 Add the $user_id parameter | BuddyPress 2.5.0 Add the $user_id parameter |
BuddyPress 1.5.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.