function simple_sitemap_menu_delete in Simple XML sitemap 4.x
Same name and namespace in other branches
- 8.3 simple_sitemap.module \simple_sitemap_menu_delete()
- 8.2 simple_sitemap.module \simple_sitemap_menu_delete()
Implements hook_menu_delete().
Removes settings for the removed menu.
Parameters
\Drupal\system\MenuInterface $menu:
Throws
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
\Drupal\Component\Plugin\Exception\PluginNotFoundException
File
- ./
simple_sitemap.module, line 236 - Main module file containing hooks.
Code
function simple_sitemap_menu_delete(MenuInterface $menu) {
/** @var \Drupal\simple_sitemap\Manager\Generator $generator */
$generator = \Drupal::service('simple_sitemap.generator');
$generator
->setVariants(TRUE)
->entityManager()
->removeBundleSettings('menu_link_content', $menu
->id());
}