function hook_menu_alter

hook_menu_alter(&$items)

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

File

modules/system/system.api.php, line 1292
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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_menu_alter/7.x