bp_notifications_delete_notifications_by_item_id( int $user_id, int $item_id, string $component_name, string $component_action, int|bool $secondary_item_id = false )
Delete notifications for an item ID.
Description
Used when clearing out notifications for a specific component when the user has visited that component.
Parameters
- $user_id
-
(Required) ID of the user whose notifications are being deleted.
- $item_id
-
(Required) ID of the associated item.
- $component_name
-
(Required) Name of the associated component.
- $component_action
-
(Required) Name of the associated action.
- $secondary_item_id
-
(Optional) ID of the secondary associated item.
Default value: false
Return
(int|false) True on success, false on failure.
Source
File: bp-notifications/bp-notifications-functions.php
function bp_notifications_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) { return BP_Notifications_Notification::delete( array( 'user_id' => $user_id, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'component_name' => $component_name, 'component_action' => $component_action, ) ); }
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.