Viewing 1 replies (of 1 total)
  • 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. https://www.pearlbells.co.uk/user-role-editor-access-wordpress-plugins/

Viewing 1 replies (of 1 total)
  • The topic ‘Allow Editor user role access to plugin’ is closed to new replies.