1 admin_bar.module admin_bar_translated_menu_link_alter(&$item, $map)

Implements hook_translated_menu_link_alter().

Here is where we make changes to links that need dynamic information such as the current page path or the number of users.

File

core/modules/admin_bar/admin_bar.module, line 635
Render an administrative bar as a dropdown menu at the top of the window.

Code

function admin_bar_translated_menu_link_alter(&$item, $map) {
  if ($item['menu_name'] != 'admin_bar') {
    return;
  }

  // Prepare links that would not be displayed normally.
  if (!$item['access']) {
    $item['access'] = TRUE;
    // Prepare for http://drupal.org/node/266596
    if (!isset($item['localized_options'])) {
      _menu_item_localize($item, $map, TRUE);
    }
  }

  // Don't waste cycles altering items that are not visible
  if (!$item['access']) {
    return;
  }
}