[wp-hackers] simple method to hide admin menus

Mindshare Studios info at mindsharestudios.com
Fri Sep 7 18:20:32 GMT 2007

Hey all,

Has anyone came up with a simple way to hide various admin menu items? I
know about Barun's Custom Admin Menu plugin, which is great, but I want to
add the ability to a plugin I am working on without all the extra features
for modifying the menu, etc.

I've seen code like this (from Patrick Khoo) to hide the dashboard, but I
don't really understand how one would modify it to target other menu items:

function dwpage_restrict_adminhead() {
	global $menu;

		unset($menu[0]); // hide dashboard


It seems like targeting menu items by their index in the menu array would
not be the best way to do this. Also how would you query the $menu array to
see what menu item mapped to what index?


Damian Taggart
Mindshare Studios, Inc.

More information about the wp-hackers mailing list