function xmlsitemap_menu_menu_link_alter in XML sitemap 7.2
Implements hook_menu_link_alter().
We have to use this hook rather than hook_menu_link_update() because this hook is not always called if the user does not edit the core menu item fields.
See also
https://www.drupal.org/node/1013856
File
- xmlsitemap_menu/
xmlsitemap_menu.module, line 231 - Main file for XML sitemap menu.
Code
function xmlsitemap_menu_menu_link_alter(array &$link) {
if (!empty($link['mlid'])) {
$link += array(
'xmlsitemap' => array(),
);
xmlsitemap_menu_xmlsitemap_process_menu_links(array(
$link['mlid'],
), $link['xmlsitemap']);
}
}