Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save strangerstudios/dd994551e2cdcc6ec5a3 to your computer and use it in GitHub Desktop.
Save strangerstudios/dd994551e2cdcc6ec5a3 to your computer and use it in GitHub Desktop.
my_pmpro_default_registration_level
<?php
/**
* 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');
?>
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Apply a Default PMPro Membership Level During WordPress User Registration" at Paid Memberships Pro here: https://www.paidmembershipspro.com/give-users-a-default-membership-level-at-registration/

@ggian311
Copy link

thanks for sharing. Do you know how to apply this also when a user is created at woocommerce checkout?

@MaryOJob
Copy link

To inherit level & expiration settings, please see: https://gist.github.com/andrewlimaza/563be9bf3a0b369fa3747ec78cad1513

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment