1 taxonomy.install taxonomy_uninstall()

Implements hook_uninstall().

File

core/modules/taxonomy/taxonomy.install, line 10
Install, update and uninstall functions for the taxonomy module.

Code

function taxonomy_uninstall() {
  // Remove taxonomy_term bundles.
  $configs = config_get_names_with_prefix('taxonomy.vocabulary.');
  foreach ($configs as $config_name) {
    $vocabulary_name = str_replace('taxonomy.vocabulary.', '', $config_name);
    field_attach_delete_bundle('taxonomy_term', $vocabulary_name);
  }

  // Remove default, un-modified view.
  $config = config('views.view.taxonomy_term');
  // Only update if view isn't overridden (VIEWS_STORAGE_OVERRIDE).
  if ($config->get('storage') != 2) {
    $config->delete();
  }
}