Title: Multi Roles
Last modified: August 20, 2016

---

# Multi Roles

 *  Resolved [jmonroe](https://wordpress.org/support/users/jmonroe/)
 * (@jmonroe)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/multi-roles/)
 * I want both administrator and other role to be able to access menu so I entered
   this on the menu item but get an error. Is there a way to make this work?
 * in_array(‘administrator’,’other_role’, $GLOBALS[‘current_user’]->roles)
 * [http://wordpress.org/extend/plugins/menu-items-visibility-control/](http://wordpress.org/extend/plugins/menu-items-visibility-control/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [jmonroe](https://wordpress.org/support/users/jmonroe/)
 * (@jmonroe)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/multi-roles/#post-3216368)
 * Nevermind…I have answered my own questions and got it working.
 *  Plugin Author [shazdeh](https://wordpress.org/support/users/shazdeh/)
 * (@shazdeh)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/multi-roles/#post-3216431)
 * In case someone else might find it useful, the syntax should be like this:
    `
   in_array('administrator', $GLOBALS['current_user']->roles) || in_array('other_role',
   $GLOBALS['current_user']->roles)`
 *  Thread Starter [jmonroe](https://wordpress.org/support/users/jmonroe/)
 * (@jmonroe)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/multi-roles/#post-3216434)
 * You actually do not need to do all of that shazdeh. Just simply do in_array(‘
   administrator’&&’other role’, $GLOBALS[‘current_user’]->roles)
 * This is the method I am using on my site and it works great.
 *  [dexter10](https://wordpress.org/support/users/dexter10/)
 * (@dexter10)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/multi-roles/#post-3216494)
 * Sorry to say jmonroe that your solution doesn’t work for me with more than two
   roles. It does however work with shazdeh’s solution of using role || role || 
   role, etc.
 * As a side note, the roles need to be in the form of ‘other_role’ and not ‘other-
   role’. This one had me going for a while.
 *  [rdwadhwani](https://wordpress.org/support/users/rdwadhwani/)
 * (@rdwadhwani)
 * [12 years, 12 months ago](https://wordpress.org/support/topic/multi-roles/#post-3216508)
 * Thank you everyone…

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Multi Roles’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/menu-items-visibility-control.svg)
 * [Menu Item Visibility Control](https://wordpress.org/plugins/menu-items-visibility-control/)
 * [Support Threads](https://wordpress.org/support/plugin/menu-items-visibility-control/)
 * [Active Topics](https://wordpress.org/support/plugin/menu-items-visibility-control/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/menu-items-visibility-control/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/menu-items-visibility-control/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [rdwadhwani](https://wordpress.org/support/users/rdwadhwani/)
 * Last activity: [12 years, 12 months ago](https://wordpress.org/support/topic/multi-roles/#post-3216508)
 * Status: resolved