| Versions | |
|---|---|
| 7 | hook_menu_link_update($link) |
Inform modules that a menu link has been updated.
This hook is used to notify modules that menu items have been updated. Contributed modules may use the information to perform actions based on the information entered into the menu system.
$link Associative array defining a menu link as passed into menu_link_save().
drupal/
<?php
function hook_menu_link_update($link) {
// If the parent menu has changed, update our record.
$menu_name = db_result(db_query("SELECT mlid, menu_name, status FROM {menu_example} WHERE mlid = :mlid", array(':mlid' => $link['mlid'])));
if ($menu_name != $link['menu_name']) {
db_update('menu_example')
->fields(array('menu_name' => $link['menu_name']))
->condition('mlid', $link['mlid'])
->execute();
}
}
?>