/** * Delete all notifications for a user * * Used when clearing out all notifications for a user, whene deleted or spammed * * @deprecated Deprecated since BuddyPress 1.9.0. Use * bp_notifications_delete_notifications_from_user() instead. * * @since BuddyPress (1.0) * @param int $user_id * @param string $component_name * @param string $component_action * @return boolean True on success, false on fail */ function bp_core_delete_notifications_from_user($user_id, $component_name, $component_action) { // Bail if notifications is not active if (!bp_is_active('notifications')) { return false; } // Trigger the deprecated function notice _deprecated_function(__FUNCTION__, '1.9', 'bp_notifications_delete_notifications_from_user()'); return bp_notifications_delete_notifications_from_user($user_id, $component_name, $component_action); }
/** * Delete new group membership notifications when a user is being deleted. * * @since 1.9.0 * * @param int $user_id ID of the user. */ function bp_groups_remove_data_for_user_notifications($user_id) { if (bp_is_active('notifications')) { bp_notifications_delete_notifications_from_user($user_id, buddypress()->groups->id, 'new_membership_request'); } }
/** * Remove friendship requests FROM user, used primarily when a user is deleted. * * @since 1.9.0 * * @param int $user_id ID of the user whose notifications are removed. */ function bp_friends_remove_notifications_data($user_id = 0) { if (bp_is_active('notifications')) { bp_notifications_delete_notifications_from_user($user_id, buddypress()->friends->id, 'friendship_request'); } }