function xmlsitemap_uninstall in XML sitemap 2.x
Same name and namespace in other branches
- 8 xmlsitemap.install \xmlsitemap_uninstall()
- 5.2 xmlsitemap/xmlsitemap.install \xmlsitemap_uninstall()
- 5 xmlsitemap.install \xmlsitemap_uninstall()
- 6.2 xmlsitemap.install \xmlsitemap_uninstall()
- 6 xmlsitemap.install \xmlsitemap_uninstall()
- 7.2 xmlsitemap.install \xmlsitemap_uninstall()
Implements hook_uninstall().
File
- ./
xmlsitemap.install, line 336 - Install, update and uninstall functions for the xmlsitemap module.
Code
function xmlsitemap_uninstall() {
$variables = array_keys(xmlsitemap_state_variables());
foreach ($variables as $variable) {
\Drupal::state()
->delete($variable);
}
// Remove the file cache directory.
xmlsitemap_clear_directory(NULL, TRUE);
$entity_types = \Drupal::entityTypeManager()
->getDefinitions();
$bundles = \Drupal::service('entity_type.bundle.info')
->getAllBundleInfo();
foreach ($entity_types as $entity_type_id => $entity_type) {
if (isset($bundles[$entity_type_id])) {
foreach ($bundles[$entity_type_id] as $bundle_id => $bundle) {
xmlsitemap_link_bundle_delete($entity_type_id, $bundle_id);
}
}
}
}