function hook_taxonomy_menu_link_alter in Taxonomy menu 8
Same name and namespace in other branches
- 7.2 taxonomy_menu.api.php \hook_taxonomy_menu_link_alter()
Allows modules to alter the menu link before saved.
Parameters
$menu_link: The menu link will be saved.
$term: The taxonomy term
$menu_name: The machine name of the menu in which the menu link should be saved.
1 invocation of hook_taxonomy_menu_link_alter()
- taxonomy_menu_menu_link_save in ./
taxonomy_menu.module - Saves a menu link in a menu, based on a taxonomy term.
File
- ./
taxonomy_menu.api.php, line 19 - This file contains no working PHP code; it exists to document hooks in the standard Drupal manner.
Code
function hook_taxonomy_menu_link_alter(&$menu_link, $term, $menu_name) {
// For example, change the link_title and options
$wrapper = entity_metadata_wrapper('taxonomy_term', $term);
$menu_link['link_title'] .= '<span class="tibetan">' . $wrapper->field_tibetan_name
->value() . '</span>';
$menu_link['options']['html'] = TRUE;
}