menu_set_active_menu_names

  1. drupal
    1. 8
    2. 7
Versions
7 – 8 menu_set_active_menu_names($menu_names = NULL)

Set (or get) the active menu for the current page - determines the active trail.

Related topics

▾ 2 functions call menu_set_active_menu_names()

book_page_alter in modules/book/book.module
Implements hook_page_alter().
menu_get_active_menu_names in includes/menu.inc
Get the active menu for the current page - determines the active trail.

Code

includes/menu.inc, line 2264

<?php
function menu_set_active_menu_names($menu_names = NULL) {
  $active = &drupal_static(__FUNCTION__);

  if (isset($menu_names) && is_array($menu_names)) {
    $active = $menu_names;
  }
  elseif (!isset($active)) {
    $active = variable_get('menu_default_active_menus', array_keys(menu_list_system_menus()));
  }
  return $active;
}
?>