1. drupal
    1. 6
    2. 8
    3. 7
6 – 8 menu_link_load($mlid)

Get a menu link by its mlid, access checked and link translated for rendering.

This function should never be called from within node_load() or any other function used as a menu object load function since an infinite recursion may occur.


$mlid The mlid of the menu item.

Return value

A menu link, with $item['access'] filled and link translated for rendering.

Related topics

▾ 9 functions call menu_link_load()

MenuLinksUnitTestCase::assertMenuLinkParents in modules/simpletest/tests/menu.test
Assert that at set of links is properly parented.
MenuNodeTestCase::testMenuNodeFormWidget in modules/menu/menu.test
Test creating, editing, deleting menu links via node form widget.
MenuTestCase::getStandardMenuLink in modules/menu/menu.test
Get standard menu link.
MenuTestCase::testMenu in modules/menu/menu.test
Login users, add menus and menu links, and test menu functionality through the admin and user interfaces.
menu_edit_menu_submit in modules/menu/
Submit function for adding or editing a custom menu.
menu_node_prepare in modules/menu/menu.module
Implements hook_node_prepare().
shortcut_set_customize_submit in modules/shortcut/
Submit handler for shortcut_set_customize().
system_get_module_admin_tasks in modules/system/system.module
Generate a list of tasks offered by a specified module.
_menu_delete_item in includes/
Helper function for menu_link_delete; deletes a single menu link.


includes/, line 2571

function menu_link_load($mlid) {
  if (is_numeric($mlid)) {
    $query = db_select('menu_links', 'ml');
    $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
    // Weight should be taken from {menu_links}, not {menu_router}.
    $query->addField('ml', 'weight', 'link_weight');
    $query->condition('ml.mlid', $mlid);
    if ($item = $query->execute()->fetchAssoc()) {
      $item['weight'] = $item['link_weight'];
      return $item;
  return FALSE;