-
Author
-
January 23, 2019 at 17:03 #217198forrestParticipant
Regarding the KLEO included Membership plugin, is there a function to assign a Membership Level automatically to all new WP Users created?
We are using Google login plugin to automatically create a WP User when we set them up by email. This works great in creating their WP User, but still requires us to manually give them a membership level.
We are looking to automate that process by having a membership level automatically assigned to all new users created.
January 24, 2019 at 04:22 #217231LauraModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! ?Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
January 24, 2019 at 17:17 #217255RaduModeratorHi,
Using this snippet you can assign a certain membership at signup.
COPY CODE/** * 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');
It can be added into child theme functions.php, make sure to have child theme activated.
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJanuary 24, 2019 at 17:21 #217257forrestParticipantThanks for the reply….
Quick follow up –
we are on boarding people into the community via the normal WordPress “User” tab interface currently (because we are using Google Apps Login to assign emails and auto User level)
We aren’t using the PMP as a signup, but rather a way to limit/protect community pages…
? will your code snippet still work in this use case if we do not use PMP for signup?
January 25, 2019 at 19:48 #217305RaduModeratorHi,
YEs,
So you are using the wp roles ?
If yes you can use the next snippet to change the user default assigned ‘Subscriber’ role at signup to your desired one.
COPY CODEadd_filter('pre_option_default_role', function($default_role){ // You can also add conditional tags here and return whatever return 'subscriber'; // This is changed return $default_role; // This allows default });
taken from here; https://wordpress.stackexchange.com/questions/31791/how-do-i-programmatically-set-default-role-for-new-users
Let me know
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘Plugins questions’ is closed to new topics and replies.