Allow editors access to added plugins

Please add the following code.

function activate_plugin_name() {
   $role = get_role( 'editor' );
   $role->add_cap( 'manage_options' ); // capability
}
// Register our activation hook
register_activation_hook( __FILE__, 'activate_plugin_name' );

function deactivate_plugin_name() {

  $role = get_role( 'editor' );
  $role->remove_cap( 'manage_options' ); // capability
}
// Register our de-activation hook
register_deactivation_hook( __FILE__, 'deactivate_plugin_name' );`

Refer my tutorial for further explanation.
http://www.pearlbells.co.uk/user-role-editor-access-wordpress-plugins/

Leave a Comment