function hook_menu_insert

Respond to a custom menu creation.

This hook is used to notify modules that a custom menu has been created. Contributed modules may use the information to perform actions based on the information entered into the menu system.


$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



Related topics

1 invocation of hook_menu_insert()
menu_save in drupal/modules/menu/menu.module
Save a custom menu.


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


function hook_menu_insert($menu) {

  // For example, we track available menus in a variable.
  $my_menus = variable_get('my_module_menus', array());
  $my_menus[$menu['menu_name']] = $menu['menu_name'];
  variable_set('my_module_menus', $my_menus);