Skip to main content

Modify the links in admin_menu through the use of the hook_admin_menu_output_alter() function

How can you modify the links in admin_menu? Through the use of the hook_admin_menu_output_alter() function. For example if you would like to hide the 'Tasks' and 'Index' Links from the admin toolbar or hide the structure / taxonomy Menu links and just add a custom Link using a drupal custom taxonomy vocabulary access module, just use the following hook in my case i removed the admin/index & admin/structure menu links (use dpm() to find the approriate $content['menu'] array items) uid == 10) { unset($content['menu']['admin/index']); unset($content['menu']['admin/structure']); } } ?>
hook admin_menu drupal7