bp_notifications_mark_notification( int $id, int|bool $is_new = false )

Mark notification read/unread for a user by ID.


Description Description

Used when clearing out notifications for a specific notification item.


Top ↑

Parameters Parameters

$id

(int) (Required) ID of the notification.

$is_new

(int|bool) (Optional) 0 for read, 1 for unread.

Default value: false


Top ↑

Return Return

(false|int) True on success, false on failure.


Source Source

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

function bp_notifications_mark_notification( $id, $is_new = false ) {
	if ( ! bp_notifications_check_notification_access( bp_displayed_user_id(), $id ) ) {
		return false;
	}

	return BP_Notifications_Notification::update(
		array( 'is_new' => $is_new ),
		array( 'id'     => $id     )
	);
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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