function hook_menu_update

Respond to a custom menu update.

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

Parameters

\Drupal\system\Plugin\Core\Entity\Menu $menu: A menu entity.

See also

hook_menu_insert()

hook_menu_delete()

Related topics

1 function implements hook_menu_update()

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

menu_menu_update in drupal/core/modules/menu/menu.module
Implements hook_menu_update().

File

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

Code

function hook_menu_update($menu) {

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