bp_activity_remove_screen_notifications_for_non_mentions()

Mark non-mention notifications as read when user visits our read permalink.


Description Description

In particular, ‘update_reply’ and ‘comment_reply’ notifications are handled here. See bp_activity_format_notifications() for more info.


Source Source

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

function bp_activity_remove_screen_notifications_for_non_mentions() {
	if ( false === is_singular() || false === is_user_logged_in() || empty( $_GET['nid'] ) ) {
		return;
	}

	// Mark notification as read.
	BP_Notifications_Notification::update(
		array(
			'is_new'  => false
		),
		array(
			'user_id' => bp_loggedin_user_id(),
			'id'      => (int) $_GET['nid']
		)
	);
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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