function hook_uc_roles_delete in Ubercart 6.2
Allows modules to react to the removal of an expiring role.
Parameters
$account: The Drupal user object.
$rid: The Drupal role ID.
1 invocation of hook_uc_roles_delete()
- uc_roles_delete in uc_roles/
uc_roles.module - Deletes an expiration using user id or user id and rid.
File
- docs/
hooks.php, line 1888 - These are the hooks that are invoked by the Ubercart core.
Code
function hook_uc_roles_delete($account, $rid) {
// Example: set the expiration date CCK field on a content profile node
// to midnight of the current date when an expiring role is deleted
$node = content_profile_load('profile', $account->uid, '', true);
if ($node) {
$node->field_expiration_date['0']['value'] = date('Y-m-dT00:00:00');
node_save($node);
}
}