Created
June 24, 2017 22:22
-
-
Save tech4him/a39cf232089766292665404441568990 to your computer and use it in GitHub Desktop.
PaidMembershipsPro - Default Membership on Registration
This file contains 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
/** | |
* When registering, add the member to a specific membership level | |
* @param integer $user_id | |
**/ | |
//Disables the pmpro redirect to levels page when user tries to register | |
add_filter("pmpro_login_redirect", "__return_false"); | |
function my_pmpro_default_registration_level($user_id) { | |
//Give all members who register membership level 1 | |
pmpro_changeMembershipLevel(1, $user_id); | |
} | |
add_action('user_register', 'my_pmpro_default_registration_level'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment