How do I deactivate a plugin for some roles

This is actually a basic PHP problem: if (in_array(‘Participant’, ‘Subscriber’, $current_user->roles)) { That’s not how in_array works. in_array checks if the first bit is in the second bit. So is Participant inside $current_user->roles. What you’ve written however, checks if Participant is inside Subscriber, then passed an array as the 3rd argument, which is meant to … Read more

WP disobeys disabling of the posts revision feature

wp-config.php is suggested place for such definitions, because at any point later they might get replaced by default values during loading. See Editing wp-config.php in Codex for thorough instructions. Also worth noting that it’s commonly said like add to the end, but really definitions should go above this line: /* That’s all, stop editing! Happy … Read more

add a function to submit options.php

You could just do a check for settings updated, and call a function. At the top of the page that renders the settings form: if ( isset( $_GET[‘settings-updated’] ) && $_GET[‘settings_updated’] == true ) { your_custom_function(); } Then define the custom function in your functions.php or add it to a class.