function node_limit_userofrole_user_role_delete in Node Limit 7
Same name and namespace in other branches
- 8 old/node_limit_userofrole/node_limit_userofrole.module \node_limit_userofrole_user_role_delete()
Implements hook_user_role_delete().
Delete all rules related to the role being deleted.
File
- node_limit_userofrole/
node_limit_userofrole.module, line 13 - Module to restrict the number of nodes by role.
Code
function node_limit_userofrole_user_role_delete($role) {
$limits = db_select('node_limit_userofrole', 'src')
->fields('src', array(
'lid',
))
->condition('rid', $role->rid)
->execute();
$lids = array();
foreach ($limits as $limit) {
$lids[] = $limit->lid;
}
node_limit_delete($lids);
}