1 menu_example.module menu_example_menu_link_alter(&$item, $menu)

Implements hook_menu_link_alter().

This code will get the chance to alter a menu link when it is being saved in the menu interface at admin/build/menu. Whatever we do here overrides anything the user/administrator might have been trying to do.

Related topics

File

modules/examples/menu_example/menu_example.module, line 500
Hook implementations for the Menu Example module.

Code

function menu_example_menu_link_alter(&$item, $menu) {
  // Force the link title to remain 'Clear Cache' no matter what the admin
  // does with the web interface.
  if ($item['link_path'] == 'devel/cache/clear') {
    $item['link_title'] = 'Clear Cache';
  }
}