function menu_load_links

Returns an array containing all links for a menu.

Parameters

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

Return value

An array of menu links.

Related topics

3 calls to menu_load_links()
MenuTest::testMenus in drupal/core/modules/views/lib/Drupal/views/Tests/Wizard/MenuTest.php
Tests the menu functionality.
menu_delete_links in drupal/core/includes/menu.inc
Deletes all links for a menu.
shortcut_set_load in drupal/core/modules/shortcut/shortcut.module
Loads the data for a shortcut set.

File

drupal/core/includes/menu.inc, line 2899
API for the Drupal menu system.

Code

function menu_load_links($menu_name) {
  $links = db_select('menu_links', 'ml', array(
    'fetch' => PDO::FETCH_ASSOC,
  ))
    ->fields('ml')
    ->condition('ml.menu_name', $menu_name)
    ->orderBy('weight')
    ->execute()
    ->fetchAll();
  foreach ($links as &$link) {
    $link['options'] = unserialize($link['options']);
  }
  return $links;
}