You are here

function simple_sitemap_menu_delete in Simple XML sitemap 8.3

Same name and namespace in other branches
  1. 8.2 simple_sitemap.module \simple_sitemap_menu_delete()
  2. 4.x 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 233
Main module file containing hooks.

Code

function simple_sitemap_menu_delete(MenuInterface $menu) {

  /** @var \Drupal\simple_sitemap\Simplesitemap $generator */
  $generator = \Drupal::service('simple_sitemap.generator');
  $generator
    ->setVariants(TRUE)
    ->removeBundleSettings('menu_link_content', $menu
    ->id());
}