[wp-hackers] hide custom admin menu entries

Frank Bueltge frank at bueltge.de
Wed Aug 18 07:03:45 UTC 2010


WP have 3 vars for the different menus. The Plugin Adminimize list this and
let you hide areas and menu-entries for different user-roles.

On Wed, Aug 18, 2010 at 7:59 AM, Mike Schinkel
<mikeschinkel at newclarity.net>wrote:

> 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
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list