menu_ui_menu_predelete

menu_ui_menu_predelete(Menu $menu)

Implements hook_ENTITY_TYPE_predelete() for menu entities.

File

core/modules/menu_ui/menu_ui.module, line 98
Allows administrators to customize the site's navigation menus.

Code

function menu_ui_menu_predelete(Menu $menu) {
  // Delete all links from the menu.
  /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
  $menu_link_manager = \Drupal::service('plugin.manager.menu.link');
  $menu_link_manager->deleteLinksInMenu($menu->id());
}
doc_Drupal
2016-10-29 09:27:52
Comments
Leave a Comment

Please login to continue.