menu_get_root_menus
Definition
menu_get_root_menus()
includes/menu.inc, line 295
Description
Retrieves the menu ID and title of all root menus.
Return value
Array containing all menus (but not menu items), in the form mid => title.
Related topics
| Name | Description |
|---|---|
| Menu system | Define the navigation menus, and route page requests to code based on URLs. |
Code
<?php
function menu_get_root_menus() {
$menu = menu_get_menu();
$root_menus = array();
foreach ($menu['items'][0]['children'] as $mid) {
$root_menus[$mid] = $menu['items'][$mid]['title'];
}
return $root_menus;
}
?> 