bp_notifications_delete_notifications_on_user_delete( int $user_id )

Delete a user’s notifications when the user is deleted.

Description

Parameters

$user_id

(Required) ID of the user who is about to be deleted.

Return

(int|false) The number of rows deleted, or false on error.

Source

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

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

Changelog

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