• Resolved jbonlinea

    (@jbonlinea)


    Hi there,

    I have seen that pmp create some capabilities.
    I’ve granted them all to the a custom role “manager” I’ve created.

    Now user having this role can acces to pmp dashboard and do what thy want ! Great

    I’ve also granted this user role with wordpress built-in capability to manage user, namely add_users, edit_users, list_users, remove_users and promote_users.

    Users with the role manager can now acces to any user profile page.
    However the profile page do not show pmp field, as with a wp admin account.

    I thus looked for a solution beyound that and have found this page and added this in my theme function.php

    apply_filters("pmpro_edit_member_capability", "edit_users");

    but I can’t see any change ?!

    If I give my Manager role the edit_option capability, then it works/

    How do I enable Managers to edit membership data from users edit page without granting the edit_options capability ?

    Any guidance would be greatly appreciated.

    • This topic was modified 2 years, 9 months ago by jbonlinea.
Viewing 1 replies (of 1 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hi @jbonlinea

    Thank you for reaching out, I’ve just tested this and it works as intended with your setup.

    Here is the code snippet I used to adjust the capability of editing a user:

    function sample_change_cap_to_edit_member( $cap ) {
      $cap = 'edit_users';
      return $cap;
    }
    add_filter( 'pmpro_edit_member_capability', 'sample_change_cap_to_edit_member' );

    I also ensured that this test role had all the pmpro_ prefixed capabilities as I wasn’t totally sure if they only needed access to some and not other areas of Paid Memberships Pro.

    I hope this helps get you started.

Viewing 1 replies (of 1 total)
  • The topic ‘PMP Manager capability’ is closed to new replies.