2 * Implements hook_user_cancel_methods_alter().
4 function {{ machine_name }}_user_cancel_methods_alter(&$methods) {
5 // Limit access to disable account and unpublish content method.
6 $methods['user_cancel_block_unpublish']['access'] = user_access('administer site configuration');
8 // Remove the content re-assigning method.
9 unset($methods['user_cancel_reassign']);
11 // Add a custom zero-out method.
12 $methods['mymodule_zero_out'] = array(
13 'title' => t('Delete the account and remove all content.'),
14 'description' => t('All your content will be replaced by empty strings.'),
15 // access should be used for administrative methods only.
16 'access' => user_access('access zero-out account cancellation method'),