function shortcut_install

Same name in other branches
  1. 7.x modules/shortcut/shortcut.install \shortcut_install()
  2. 9 core/modules/shortcut/shortcut.install \shortcut_install()
  3. 10 core/modules/shortcut/shortcut.install \shortcut_install()
  4. 11.x core/modules/shortcut/shortcut.install \shortcut_install()

Implements hook_install().

File

core/modules/shortcut/shortcut.install, line 52

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);
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.