bp_notifications_delete_notifications_from_user( int $user_id, string $component_name, string $component_action )

Delete all notifications from a user.

Description

Used when clearing out all notifications for a user, when deleted or spammed.

Parameters

$user_id

(Required) ID of the user whose associated items are being deleted.

$component_name

(Required) Name of the associated component.

$component_action

(Required) Name of the associated action.

Return

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

Source

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

function bp_notifications_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
	return BP_Notifications_Notification::delete( array(
		'item_id'           => $user_id,
		'component_name'    => $component_name,
		'component_action'  => $component_action,
	) );
}

Changelog

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