Support » Plugin: Menu Item Visibility Control » Visibility depending user role

  • Resolved Yunis777



    If I want a menu item to be visible to ‘administrator’, ‘candidate’ and non-logged in users, what could should I enter?
    The item should be visible to any user that comes under any of the following roles:
    – administrator
    – candidate
    – non-logged in user (= visitor)
    However, if the user has logged-in and its user role is ’employer’, the item has to be invisible.
    What code should be formulated with this plugin?

    Look forward to hearing from you,


Viewing 2 replies - 1 through 2 (of 2 total)
  • the easiest thing I could think is:

    do you have only those 4 roles? (admin, candidate, employer and non-logged)

    if yes, you could use


    otherwise you can always use || operator to verify multiple conditions and the function current_user_can()

    !is_user_logged_in() || current_user_can('administrator') || current_user_can('candidate')


    The code you gave me for the plugin customization worked. Thanks.



Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Visibility depending user role’ is closed to new replies.