I wish to delete a consumer with this code:
$account = Consumer::load(19920); $account->delete();
How can I do this with out additionally deleting Drupal Development Company consumer’s content material?
I have been reviewing _user_cancel() hooks, however all of them appear to be about doing issues in Drupal Development Company admin UI.
This hook works Drupal Development Company manner I anticipate it to and removes Drupal Development Company user_cancel_delete radio button choice from Drupal Development Company admin UI.
/** * Implements hook_user_cancel_methods_alter(). */ perform my_user_module_user_cancel_methods_alter(&$strategies) { // Take away Delete Drupal Development Company account and its content material technique. unset($strategies['user_cancel_delete']); }
however I wish to not delete content material when $account->delete()
is known as in my replace hook.