Support » Plugin: Paid Memberships Pro » Allow editors to change/add membership levels for members

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Jason Coleman

    (@strangerstudios)

    Hi, Bob. The plugin is set to only allow administrators to change membership levels on users. You can change the permission here:
    https://github.com/strangerstudios/paid-memberships-pro/blob/dev/includes/profile.php#L9

    And then further down it checks if a the user can edit the user being edited before saving the changes here:
    https://github.com/strangerstudios/paid-memberships-pro/blob/dev/includes/profile.php#L166

    You can change those current_user_can calls to suit your needs. I’ll look into adding filters in the next release so you can change these without hacking the core plugin.

    Thanks so much! I’ll try that.

    Prior to realizing this issue, I did manage to let Editor manage users by this code. I don’t suppose, there’s a capability that I can add to their “list” to make this work rather than hacking the plugin?

    // let editor manage users
    $edit_editor = get_role('editor'); // Get the user role
    $edit_editor->add_cap('list_users');
    $edit_editor->add_cap('create_users');
    $edit_editor->add_cap('delete_users');

    Thanks,
    Bob

    Hi Bob,

    I just wanted to let you know that we added a filter in the newest version (1.7.2) which will be released this later on this week.

    This file shows where the filter is located in the code: https://github.com/strangerstudios/paid-memberships-pro/blob/dev/includes/profile.php#L10.

    Thank You

    So grateful for your help @slocum Design Studio! Worked like a charm. Wow. Love this plugin more than ever!

    Thanks,
    Bob

    Gene

    (@gene158)

    Hi, I’m trying to accomplish the same thing as Bob, to allow my Editors to create/delete/edit new members. I’ve added the code that Bob has provided above. What else do I need to add so that Editors can change the PMP membership level as well?

    Thanks for any help, much appreciated!

    rwilki

    (@rwilki)

    Gene, it was pretty simple. If you go to the github link Slocum Desigin Studio posted above https://github.com/strangerstudios/paid-memberships-pro/blob/dev/includes/profile.php#L10 and follow the directions for which line of code is changed in the profile.php file, the change should work for you.

    Let me know if you have questions.

    BTW, my code was a guess at changing something in the functions file and it doesn’t work.

    Thanks,
    Bob

    Gene

    (@gene158)

    Hi Bob, actually your code does work, partially. It allows an editor to list, create and delete users. I did add the edit capability.

    $edit_editor->add_cap(‘edit_users’);

    Apparently, I was doing it wrong… at first, I added

    $edit_editor->add_cap(‘membership_level_capability’);

    Obviously, that was wrong, it should have been this instead

    $edit_editor->add_cap(‘manage_options’);

    Thanks!

    Gene

    (@gene158)

    Also, you may want to check this code snippet as well…

    http://wordpress.stackexchange.com/questions/4479/editor-can-create-any-new-user-except-administrator

    It will prevent your editors from modifying the administrators and prevent them from creating users with admin role.

    rwilki

    (@rwilki)

    wow thanks Gene. I’m aware of your second code snippet. GREAT piece of code. I like keeping the editor locked down as much as possible…. thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Allow editors to change/add membership levels for members’ is closed to new replies.