Network activating; if ( !current_user_can( ‘manage_options’ ) ) locks me out…
-
Hi,
I use this snippet in a plugin;
if ( !current_user_can( 'manage_options' ) ) do something }
I also tried;
if ( ! ( current_user_can( 'manage_options' ) ) ) do something }
both options work when I activate the plugin, but if I network activate it, I get locked out of the admin area. WP says “You don’t have authority to this page” or something (translating from Swedish).
And yes, the code it runs works, if I don’t do this checkup.
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 it does not work.
I also have to include the pluggable.php to get current_user_can to work at all.Any better way of checking it user does NOT have authority to manage options (does not have admin capabilities)?
It’s not necessary to network activate the plugin, but if someone does I don’t want them to be locked out of there site…
- The topic ‘Network activating; if ( !current_user_can( ‘manage_options’ ) ) locks me out…’ is closed to new replies.