7.x user.api.php hook_user_role_delete($role)

Respond to user role deletion.

This hook allows you act when a user role has been deleted. If your module stores references to roles, it's recommended that you implement this hook and delete existing instances of the deleted role in your module database tables.


$role: The $role object being deleted.

Related topics

1 function implements hook_user_role_delete()

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

block_user_role_delete in modules/block/block.module
Implements hook_user_role_delete().
1 invocation of hook_user_role_delete()
user_role_delete in modules/user/user.module
Delete a user role from database.


modules/user/user.api.php, line 468
Hooks provided by the User module.


function hook_user_role_delete($role) {

  // Delete existing instances of the deleted role.
    ->condition('rid', $role->rid)