You are here

function shortcut_install in Drupal 10

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

Implements hook_install().

File

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

Code

function shortcut_install() {

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