Failed to assign new users a Level automatically
-
Hi,
first of all: GREAT Plugin!
But one really important thing is missing for me. Thats why i created an own plugin (according to a guide on your page) to solve my issue.
Here’s “my” code:
// Assign a Paid Memberships Pro level based on user role when user roles are updated. --> von mir!!! add_action('user_register','assign_pmpro_level_to_role', 1); function assign_pmpro_level_to_role($user_id, $role, $old_roles) { //we found a role related to pmpro level if($role == "Free") { pmpro_changeMembershipLevel(2, $user_id); } elseif($role == "administrator") { pmpro_changeMembershipLevel(1, $user_id); //setup level 1 as an all access role or just give them level 2 } else { //default to no level pmpro_changeMembershipLevel(2, $user_id); } }
Actually it works fine and does what i wanted it to do. It creates new users and automatically assign the “Free”-Level. BUT the register button keeps spinning an spinning (endless) and doesnt forward to the newly created account.
Here’s a link to my site. Just try to register and you’ll see the problem: https://kufifi.at/mp2/register
Any ideas what i did wrong? Where i have a loop? How else can i implement it?
If needed i can post my login-code aswell.
I really hope you can help me?!
All the best,
NixXxon
- The topic ‘Failed to assign new users a Level automatically’ is closed to new replies.