BP_Core_Notification::delete_for_user_by_type( int $user_id, string $component_name, string $component_action )
Delete all the notifications for a user based on the component name and action.
Description
Parameters
- $user_id
-
(Required) ID of the user to delet notification for.
- $component_name
-
(Required) Component name.
- $component_action
-
(Required) Component action.
Return
(mixed)
Source
File: bp-core/classes/class-bp-core-notification.php
public static function delete_for_user_by_type( $user_id, $component_name, $component_action ) { global $wpdb; $bp = buddypress(); return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) ); }
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.