Last active
July 8, 2023 22:55
-
-
Save strangerstudios/5774136 to your computer and use it in GitHub Desktop.
Have a Paid Memberships Pro level with access to EVERYTHING.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Give level 1 members access to everything. | |
Add this to your active theme's functions.php or a custom plugin. | |
*/ | |
function my_pmpro_has_membership_access_filter($access, $post, $user) | |
{ | |
if(!empty($user->membership_level) && $user->membership_level->ID == 1) | |
return true; //level 1 ALWAYS has access | |
return $access; | |
} | |
add_filter("pmpro_has_membership_access_filter", "my_pmpro_has_membership_access_filter", 10, 3); |
This recipe is included in the blog post on "How To Have a Paid Memberships Pro level with access to EVERYTHING." at Paid Memberships Pro here: https://www.paidmembershipspro.com/how-to-have-a-paid-memberships-pro-level-with-access-to-everything/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm having trouble getting this to work. It seems that this filter isn't being run when my users arrive at a page.
Has "pmpro_has_membership_access_filter" changed to something else?