function admin_menu_remove_item in Administration menu 5.2
Same name and namespace in other branches
- 5.3 admin_menu.inc \admin_menu_remove_item()
- 5 admin_menu.inc \admin_menu_remove_item()
Removes the child pointer for a menu item.
Parameters
array $_admin_menu: An array containing the complete administration menu structure, passed by reference.
string $path: The menu path to remove, e.g. 'foo/bar'.
2 calls to admin_menu_remove_item()
- admin_menu_adjust_items in ./
admin_menu.inc - Add some hard-coded features for better user experience.
- admin_menu_move_item in ./
admin_menu.inc - Moves the child pointer of a menu item to a new parent.
File
- ./
admin_menu.inc, line 369 - Cached builder functions for Drupal Administration Menu.
Code
function admin_menu_remove_item(&$_admin_menu, $path) {
global $_menu;
$mid = $_admin_menu['index'][$path];
if (isset($_admin_menu[$mid])) {
$pid = $_admin_menu[$mid]['pid'];
$child_key = array_search($mid, $_admin_menu[$pid]['children']);
if ($child_key !== FALSE) {
unset($_admin_menu[$pid]['children'][$child_key]);
return TRUE;
}
}
return FALSE;
}