• Resolved spannerz

    (@spannerz)


    Hello folks,

    I have a new membership site for my Charity.

    I have added PMP and another Members plugin by MemberPress to be able to assign Member Admin roles to some of my fellow committee members.
    On the whole this is working as intended. Member Admins log in and see the Users and Memberships menus only.
    I have added fields to my Checkout and Admin areas using Register Helper. Some of those fields are set to “only-admin” in the RH Snippet code. Only I can see them as Super Admin, when looking at the Users Profile Details page.
    Is there a way of letting my Member Admin role holders see those additional fields without making them Super Admins on the site?
    I only want them to be able to admin the Members, Orders etc, and not see the full WP Site Admin tools.

    Any assistance gratefully received.

    • This topic was modified 5 years, 2 months ago by spannerz.
    • This topic was modified 5 years, 2 months ago by spannerz. Reason: Detail added
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hi @spannerz

    Thank you for using Paid Memberships Pro.

    I’ve overlooked the Register Helper code base and the Membership Manager’s should be able to view Register Helper fields on the profile page.

    Please note that we are not allowed to support premium/paid products on ww.wp.xz.cn (even if they are downloaded for free from Github). If you need further assistance troubleshooting this, please open a ticket on http://www.paidmembershipspro.com

    Thank you for understanding.

    Thread Starter spannerz

    (@spannerz)

    Hi,
    I have fixed the issue.
    Having looked through the code pages, I find this in pmpro_register_helper.php
    function pmprorh_getProfileFields($user_id, $withlocations = false)
    {
    global $pmprorh_registration_fields;

    $profile_fields = array();
    if(!empty($pmprorh_registration_fields))
    {
    //cycle through groups
    foreach($pmprorh_registration_fields as $where => $fields)
    {
    //cycle through fields
    foreach($fields as $field)
    {
    if(!is_a($field, ‘PMProRH_Field’) || !pmprorh_checkFieldForLevel($field, “profile”, $user_id))
    continue;

    if(!empty($field->profile) && ($field->profile === “admins” || $field->profile === “admin” || $field->profile === “only_admin”))
    {
    if( current_user_can( ‘manage_options’ ) || current_user_can( ‘pmpro_membership_manager’ ) )
    {
    if($withlocations)
    $profile_fields[$where][] = $field;
    else
    $profile_fields[] = $field;
    }
    }
    elseif(!empty($field->profile))
    {
    if($withlocations)
    $profile_fields[$where][] = $field;
    else
    $profile_fields[] = $field;
    }
    }
    }
    }

    return $profile_fields;
    }`
    In the members plugin, that grants the Role options etc, the option for “pmpro_membership_manager” was not present, so I’ve added it as a Custom Option and granted permission to my Membership Admins role.
    Now, all the fields I have added via RH show in the User / Member Admin pages.
    Hope this helps anyone else, too.

    Thread Starter spannerz

    (@spannerz)

    Well, I thought I’d fixed it, but not completely.

    User Profile edit Page does not show Member Level or History – the current and past Orders – for my Membership Admins.

    If I grant “manage Options” to the Membership Admins role, they get far too much access.

    Plugin Author Andrew Lima

    (@andrewza)

    Thanks for the feedback, I think moving forward an easier way would be a custom solution using the show_user_profile and edit_user_profile hooks.

    The Register Helper Add On stores the data as user meta. I have added this to our internal development schedule to support a filter for better roles/capabilities and not just admins.

    If you need help in implementing this custom solution, please feel free to reach out to a local WordPress developer or post to jobs.wordpress.net

    Thank you for understanding.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Permissions for Register Helper fields.’ is closed to new replies.