menu_set_active_item

includes/menu.inc, line 1500

Versions
4.6 – 5
menu_set_active_item($path = NULL)
6 – 7
menu_set_active_item($path)

Set the active path, which determines which page is loaded.

Note that this may not have the desired effect unless invoked very early in the page load, such as during hook_boot, or unless you call menu_execute_active_handler() to generate your page output.

Parameters

$path A Drupal path - not a path alias.

Related topics

▾ 3 functions call menu_set_active_item()

drupal_access_denied in includes/common.inc
Generates a 403 error if the request is not allowed.
drupal_not_found in includes/common.inc
Generates a 404 error if the request can not be handled.
user_page in modules/user/user.pages.inc
Access callback for path /user.

Code

<?php
function menu_set_active_item($path) {
  $_GET['q'] = $path;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.