function hook_menu_alter

Alter the data being saved to the {menu_router} table after hook_menu is invoked.

This hook is invoked by menu_router_build(). The menu definitions are passed in by reference. Each element of the $items array is one item returned by a module from hook_menu. Additional items may be added, or existing items altered.

Parameters

$items: Associative array of menu router definitions returned from hook_menu().

Related topics

3 functions implement hook_menu_alter()

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

comment_menu_alter in drupal/core/modules/comment/comment.module
Implements hook_menu_alter().
translation_entity_menu_alter in drupal/core/modules/translation_entity/translation_entity.module
Implements hook_menu_alter().
views_menu_alter in drupal/core/modules/views/views.module
Implement hook_menu_alter().
1 invocation of hook_menu_alter()
menu_router_build in drupal/core/includes/menu.inc
Collects and alters the menu definitions.

File

drupal/core/modules/system/system.api.php, line 899
Hooks provided by Drupal core and the System module.

Code

function hook_menu_alter(&$items) {

  // Example - disable the page at node/add
  $items['node/add']['access callback'] = FALSE;
}