function void_menu_menu_link_alter in Void Menu 7.x
Same name and namespace in other branches
- 8.x void_menu.module \void_menu_menu_link_alter()
Implements hook_menu_link_alter().
File
- ./
void_menu.module, line 60 - Creates placeholders for menu items to use special paths, including but not limited to javascript function calls. ------------------------------------------ Written by William Hall - www.mrtheme.com Based off of special_menu_items and…
Code
function void_menu_menu_link_alter(&$item, $menu) {
//(/<void[0-9]>/g)
if (preg_match('/(<void)/is', $item['link_path'])) {
$item['options']['alter'] = TRUE;
$item['options']['unaltered_hidden'] = $item['hidden'];
$item['options']['external'] = TRUE;
}
else {
unset($item['options']['unaltered_hidden']);
$item['options']['external'] = url_is_external($item['link_path']) ? 1 : 0;
}
}