• I want to give administrator access to everything any member has access to for obvious reasons (They’re an administrator…) I did find a filter that does this:

    function proFilterasdf($hasaccess){
    	if(is_user_logged_in() && current_user_can('administrator'))
    		$hasaccess = true;
    
    	return $hasaccess;
    }
    add_filter('pmpro_has_membership_access_filter', 'proFilterasdf', 10);

    which works relatively well but I’d like for the administator to see the “My Account” page rather then user levels but I can’t find the filter to allow this. I’ve added the page template to my theme so I could try and allow this. The first IF statement I allow admins but there’s a redirect before that somewhere in a filter that is telling non-members to go to the Levels page instead of “My Account”.

    What is that filter and how can I give admin access to “My Account” page instead of Levels.

    https://wordpress.org/plugins/paid-memberships-pro/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Howdy_McGee

    (@howdy_mcgee)

    It looks like The Accounts page was unfortunately not built for everybody to view but only members. I just thought it was weird for an administrator to see Member Levels when an Administrator should be the Highest Member Level and have access to everything.

    With the preheaders for account.php not really being editable / customizable and the /pages/account.php throwing a bunch of errors if there is no member assigned. Unfortunately it looks like this may not be able to be done without editing core plugin files (which is never advisable)…

    Plugin Author Jason Coleman

    (@strangerstudios)

    Some of the checks in PMPro will check pmpro_has_membership_access(), which will check if a user has access to some content. So your filter will fix that. Other checks use pmpro_hasMembershipLevel() which is slightly different and will return false if the user has no level.

    Sounds like you need to create a separate level for your admins (check to disable sign ups) and then use code like this to give that level access to everything:
    http://www.paidmembershipspro.com/2013/06/how-to-have-a-paid-memberships-pro-level-with-access-to-everything/

    Here’s the code part of that post for non-paid PMPro members:
    https://gist.github.com/strangerstudios/5774136#file-my_pmpro_has_membership_access_filter-php

    @jason Coleman, Thanks for that function! I was also needing to have this implemented and finally found your post.

    Works great!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Give Administrator All Access’ is closed to new replies.