• Resolved Luke Allen

    (@surplu)


    Hello again,

    I recently deleted one of my levels which had an ID of 1. As a result, my newly registered members are no longer given the default level of “Basic”.

    How can I assign a level of my choice to newly registered members by default? I’ve looked everywhere but the only answer to this is blocked by paid support, and I can’t afford to pay that price for something which should be included.

    Regards,
    Luke.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hi Luke,

    Thank you for using Paid Memberships Pro.

    You should be able to use the following code snippet to assign a default level on registration (through WordPress).

    
    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');

    I hope this helps get you started.

    Thread Starter Luke Allen

    (@surplu)

    Andrew,

    I really appreciate your kindness with this. Your code worked a treat and thank you for that.

    I am just curious, is it not possible to reset the IDs without tinkering with them in PHPMyAdmin? Unfortunately they don’t seem to be editable from WordPress.

    It’s just that whenever a level is deleted and a new level is made, the ID continues to increment.

    Thank you once again for your huge help.

    Luke.

    Plugin Author Andrew Lima

    (@andrewza)

    Unfortunately not, you would need to use some SQL to reset these level ID’s as we use auto incrementing when creating levels.

    Plugin Author Andrew Lima

    (@andrewza)

    Here is some code that may help – https://gist.github.com/strangerstudios/7751640

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Newly Registered not Given Default Level’ is closed to new replies.