Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter jmonroe

    (@jmonroe)

    Nevermind…I have answered my own questions and got it working.

    Plugin Author shazdeh

    (@shazdeh)

    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

    (@jmonroe)

    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.

    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.

    Thank you everyone…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Multi Roles’ is closed to new replies.