You are here

function admin_menu_remove_item in Administration menu 5

Same name and namespace in other branches
  1. 5.3 admin_menu.inc \admin_menu_remove_item()
  2. 5.2 admin_menu.inc \admin_menu_remove_item()

Removes the child pointer for a menu item.

Parameters

admin_items: The sliced administration menu.

path: The menu path to remove.

2 calls to admin_menu_remove_item()
admin_menu_adjust_items in ./admin_menu.inc
admin_menu_move_item in ./admin_menu.inc
Moves the child pointer for a menu item to a new parent.

File

./admin_menu.inc, line 209

Code

function admin_menu_remove_item(&$admin_items, $path) {
  global $_menu;
  $mid = $_menu['path index'][$path];
  if (isset($admin_items[$mid])) {
    $pid = $admin_items[$mid]['pid'];
    $child_key = array_search($mid, $admin_items[$pid]['children']);
    if ($child_key !== false) {
      unset($admin_items[$pid]['children'][$child_key]);
      return true;
    }
    else {
      return false;
    }
  }
  return false;
}