function hook_user_delete

Respond to user deletion.

This hook is invoked from user_delete_multiple() after field_attach_delete() has been called and after the user has been removed from the database.

Modules should additionally implement hook_user_cancel() to process stored user data for other account cancellation methods.

Parameters

$account: The account that has been deleted.

See also

hook_user_predelete()

user_delete_multiple()

Related topics

2 functions implement hook_user_delete()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_crud_hook_test_user_delete in drupal/core/modules/system/tests/modules/entity_crud_hook_test/entity_crud_hook_test.module
Implements hook_user_delete().
history_user_delete in drupal/core/modules/history/history.module
Implements hook_user_delete().

File

drupal/core/modules/user/user.api.php, line 87
Hooks provided by the User module.

Code

function hook_user_delete($account) {
  drupal_set_message(t('User: @name has been deleted.', array(
    '@name' => $account->name,
  )));
}