You are here

function menu_node_get_links_by_menu in Menu Node API 7

Same name and namespace in other branches
  1. 6 menu_node.module \menu_node_get_links_by_menu()

Get all menu links assigned to a specific menu.

Parameters

$menu_name: The machine name of the menu, e.g. 'navigation'.

Return value

A simple array of menu link ids.

File

./menu_node.module, line 153
Menu Node API Manages relationships between the {node} and {menu_links} table.

Code

function menu_node_get_links_by_menu($menu_name) {
  $links = array();
  $result = db_query("SELECT mlid FROM {menu_links} WHERE menu_name = :menu_name", array(
    ':menu_name' => $menu_name,
  ));
  foreach ($result as $data) {
    $links[] = $data->mlid;
  }
  return $links;
}