_menu_get_active_trail
- Versions
- 4.6 – 5
_menu_get_active_trail()
Returns an array with the menu items that lead to the current menu item.
Code
includes/menu.inc, line 925
<?php
function _menu_get_active_trail() {
static $trail;
if (!isset($trail)) {
$trail = array();
$mid = menu_get_active_item();
// Follow the parents up the chain to get the trail.
while ($mid && ($item = menu_get_item($mid))) {
array_unshift($trail, $mid);
$mid = $item['pid'];
}
}
return $trail;
}
?>Login or register to post comments 