[wp-hackers] hide custom admin menu entries

Mike Schinkel mikeschinkel at newclarity.net
Wed Aug 18 05:59:38 UTC 2010


On Aug 17, 2010, at 10:51 PM, sansbacon wrote:
> I am using the following code to hide a number of the admin menu items
> from non-administrative users:
> 
> global $submenu, $menu;
> $menuToHide = array(10, 15, 25, 59, 60, 65, 70, 75, 80);
> foreach($menuToHide as $item) {
>   unset($menu[$item]);
> }
> 
> How do I get the index in $menu for third-party plugin menu entries,
> in my case, Easy Post Types added a menu that I dont' want most users
> to see.

Loop thru $GLOBALS['menu'] and look for it?  (But I'm sure the answer you need isn't that easy...)

-Mike


More information about the wp-hackers mailing list