function hook_menu_delete

7.x menu.api.php hook_menu_delete($menu)

Respond to a custom menu deletion.

This hook is used to notify modules that a custom menu along with all links contained in it (if any) has been deleted. Contributed modules may use the information to perform actions based on the information entered into the menu system.

Parameters

$menu: An array representing a custom menu:

  • menu_name: The unique name of the custom menu.
  • title: The human readable menu title.
  • description: The custom menu description.

See also

hook_menu_insert()

hook_menu_update()

Related topics

1 function implements hook_menu_delete()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

block_menu_delete in drupal/modules/block/block.module
Implements hook_menu_delete().
1 invocation of hook_menu_delete()
menu_delete in drupal/modules/menu/menu.module
Delete a custom menu and all contained links.

File

drupal/modules/menu/menu.api.php, line 78
Hooks provided by the Menu module.

Code

function hook_menu_delete($menu) {
  // Delete the record from our variable.
  $my_menus = variable_get('my_module_menus', array());
  unset($my_menus[$menu['menu_name']]);
  variable_set('my_module_menus', $my_menus);
}