You are here

function taxonomy_menu_ui_uninstall in Taxonomy Menu UI 8

Implements hook_uninstall().

File

./taxonomy_menu_ui.install, line 13
Taxonomy Menu UI installation file.

Code

function taxonomy_menu_ui_uninstall() {
  $logger = \Drupal::logger('taxonomy_menu_ui');

  /** @var \Drupal\Core\Entity\EntityInterface $bundle */
  foreach (Vocabulary::loadMultiple() as $bundle) {
    $config_name = 'core.entity_form_display.taxonomy_term.' . $bundle
      ->id() . '.default';
    try {
      \Drupal::service('config.factory')
        ->getEditable($config_name)
        ->clear('content.menu')
        ->save();
    } catch (\Exception $e) {
      $logger
        ->warning(sprintf('Unable to uninstall config: %s.', $config_name));
    }
  }
}