Action
rpress_detach_deleted_user
On this page
Fires after a deleted WordPress user is detached from their customer record.
Runs in rpress_detach_deleted_user(), which is hooked to the WordPress delete_user action. If a matching customer exists, its user_id is set to 0 first. The customer record itself is kept.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$user_id | int | ID of the user being deleted. |
$customer | RPRESS_Customer | The customer object looked up by user ID. Its id is 0 when no customer exists. |
$detached | bool|int | Result of the customer update, or false if no customer was found. |
Example#
function my_after_detach_user( $user_id, $customer, $detached ) {
if ( $detached && $customer->id > 0 ) {
error_log( sprintf( 'Customer %d detached from deleted user %d.', $customer->id, $user_id ) );
}
}
add_action( 'rpress_detach_deleted_user', 'my_after_detach_user', 10, 3 );
Source#
Fired from:
includes/user-functions.php(line 870), inrpress_detach_deleted_user()
Was this page helpful?
