You are here

function stringoverrides_uninstall in String Overrides 8

Same name and namespace in other branches
  1. 5 stringoverrides.install \stringoverrides_uninstall()
  2. 6 stringoverrides.install \stringoverrides_uninstall()
  3. 7 stringoverrides.install \stringoverrides_uninstall()

Implements hook_uninstall().

File

./stringoverrides.install, line 11
Install and uninstall.

Code

function stringoverrides_uninstall() {

  // Remove all stored string replacements.
  $config_factory = \Drupal::service('config.factory');
  $config_names = $config_factory
    ->listAll('stringoverrides.string_override.');
  foreach ($config_names as $config_name) {
    $config = $config_factory
      ->getEditable($config_name);
    $config
      ->delete();
  }
}