function styleswitcher_themes_uninstalled in Style Switcher 8.2
Same name and namespace in other branches
- 3.0.x styleswitcher.module \styleswitcher_themes_uninstalled()
Implements hook_themes_uninstalled().
File
- ./
styleswitcher.module, line 561 - Module's hooks implementations and helper functions.
Code
function styleswitcher_themes_uninstalled(array $theme_list) {
// Delete styleswitcher settings of disabled themes.
$config = Drupal::configFactory()
->getEditable('styleswitcher.styles_settings');
$settings = $config
->get('settings') ?? [];
$settings = array_diff_key($settings, array_flip($theme_list));
$config
->set('settings', $settings)
->save();
}