I use this snippet in a plugin;
if ( ! ( current_user_can( 'manage_options' ) ) ) do something }
but problem is, when network activating this on a multi-site installation, I get locked out of admin pages. WP says “You don’t have authority to this page” or something (translating from Swedish).
I have, by trial and error, limited down the problem to the function "current_user_can" but is_super_admin gives the same result. I get locked out. Please note that this only happens when network activating on a multisite installation. If I activate the plugin per site everything works as expected. See github for an example of how I try to implement it.
How come? I’ve tried it out many times and tried to tweak the code, but I can't get it to work.
Any better way of checking it user does NOT have authority to manage options (does not have admin capabilities)?