You are here

function menu_link_content_menu_delete in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/menu_link_content/menu_link_content.module \menu_link_content_menu_delete()

Implements hook_menu_delete().

File

core/modules/menu_link_content/menu_link_content.module, line 34
Allows administrators to create custom menu links.

Code

function menu_link_content_menu_delete(MenuInterface $menu) {
  $storage = \Drupal::entityManager()
    ->getStorage('menu_link_content');
  $menu_links = $storage
    ->loadByProperties(array(
    'menu_name' => $menu
      ->id(),
  ));
  $storage
    ->delete($menu_links);
}