You are here

function shortcut_user_delete in Drupal 10

Implements hook_ENTITY_TYPE_delete().

File

core/modules/shortcut/shortcut.module, line 391
Allows users to manage customizable lists of shortcut links.

Code

function shortcut_user_delete(EntityInterface $entity) {

  // Clean up shortcut set mapping of removed user account.
  \Drupal::entityTypeManager()
    ->getStorage('shortcut_set')
    ->unassignUser($entity);
}