1. drupal
    1. 8
    2. 7
7 – 8 menu_load_links($menu_name)

Returns an array containing all links for a menu.


$menu_name The name of the menu whose links should be returned.

Return value

An array of menu links.

Related topics

▾ 2 functions call menu_load_links()

menu_delete_links in includes/
Deletes all links for a menu.
shortcut_set_load in modules/shortcut/shortcut.module
Loads the data for a shortcut set.


includes/, line 2888

function menu_load_links($menu_name) {
  $links = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC))
    ->condition('ml.menu_name', $menu_name)
    // Order by weight so as to be helpful for menus that are only one level
    // deep.

  foreach ($links as &$link) {
    $link['options'] = unserialize($link['options']);
  return $links;