• Resolved jag_man653

    (@jag_man653)


    I followed the given example for hiding unless current user is administrator:
    in_array(‘administrator’, $GLOBALS[‘current_user’]->roles)

    However, I get the following error:

    Warning: in_array() expects parameter 2 to be array, null given in /users13/domains/concoursbuilder.us/web/concours-entry/wp-content/plugins/menu-items-visibility-control/init.php(112) : eval()’d code on line 1

    The page I need help with: [log in to see the link]

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

    (@shazdeh)

    wp.org used to allow showing codes in the plugin description page and it doesn’t anymore; the actual code should be:

    
    in_array('administrator', $GLOBALS['current_user']->roles)
    

    Notice the difference in the quote character ('); please ensure that is the code you have entered in the Visibility box.

Viewing 1 replies (of 1 total)
  • The topic ‘User role conditional’ is closed to new replies.