Support » Plugin: Menu Item Visibility Control » Show menu item only administrator

  • Hi,
    How show a menu item to only administrator?
    I have used a logic “in_array(‘administrator’, $GLOBALS[‘current_user’]->roles)”.
    But its not working.
    Thank you.

Viewing 1 replies (of 1 total)
  • Plugin Author shazdeh

    (@shazdeh)

    Might be better to use:

    
    current_user_can( 'manage_options' )
    

    Only admins can “manage options”, so the menu will then be displayed only to administrators.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.