You are here

function shortcut_uninstall in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/shortcut/shortcut.install \shortcut_uninstall()
  2. 7 modules/shortcut/shortcut.install \shortcut_uninstall()
  3. 9 core/modules/shortcut/shortcut.install \shortcut_uninstall()

Implements hook_uninstall().

File

core/modules/shortcut/shortcut.install, line 68
Install, update and uninstall functions for the shortcut module.

Code

function shortcut_uninstall() {

  // Theme settings are not configuration entities and cannot depend on modules
  // so to unset a module-specific setting, we need to unset it with logic.
  foreach ([
    'seven',
    'claro',
  ] as $theme) {
    if (\Drupal::service('theme_handler')
      ->themeExists($theme)) {
      \Drupal::configFactory()
        ->getEditable("{$theme}.settings")
        ->clear('third_party_settings.shortcut')
        ->save(TRUE);
    }
  }
}