1 menu.api.php | hook_menu_update($menu) |
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
$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.
- old_name: The current 'menu_name'. Note that internal menu names cannot be changed after initial creation.
See also
Related topics
File
- core/
modules/ menu/ menu.api.php, line 53 - Hooks provided by the Menu module.
Code
function hook_menu_update($menu) {
// For example, we track available menus in state.
$my_menus = state_get('my_module_menus', array());
$my_menus[$menu['menu_name']] = $menu['menu_name'];
state_set('my_module_menus', $my_menus);
}