1 menu.tokens.inc _menu_token_link_load($mlid)

Token-specific loader for menu links that maintains its own static cache.

Access checks are always skipped when loading a menu item for a token.

Parameters

int $mlid: The menu link ID of the menu item.

Return value

array: A menu link translated for rendering.

See also

menu_link_load()

File

core/modules/menu/menu.tokens.inc, line 212
Builds placeholder replacement tokens for menu-related data.

Code

function _menu_token_link_load($mlid) {
  $cache = &backdrop_static(__FUNCTION__, array());

  if (!is_numeric($mlid)) {
    return FALSE;
  }

  if (!isset($cache[$mlid])) {
    $cache[$mlid] = menu_link_load($mlid, TRUE);
  }

  return $cache[$mlid];
}