Tagged: Buddypress Member Types Pro, code
Hello,
I would like to accomplish two things, please, and can’t seem to figure it out:
1: I created a “single member type” profile field radio button. I would like to default to one of the radio buttons. How?
2: I would like to default to a member type if a user is created with social login. How?
Thanks for your help!
Pat
Hi Patrick,
Thank you for purchasing the member types pro.1. Do you want to select which member type to be set as default in the radio or the first will be fine?
2. Are you using this plugin? https://wordpress.org/plugins/wordpress-social-login/ I can supply code for it. It will be just 2-5 lines.Thank you
BrajeshThank you! Great Support.
I would prefer to be able to select the default by slug. I am not using wordpress-social-login. I am using Facebook integration from the Kleo theme.
Regards,
Pat
Hi Pat,
Thank you for the prompt reply.1. Thank you. I will be updating plugin today to provide you this option.
2. I will need to know an action hook that gets fired when the user gets created by the social login. We need to differentiate between the normal and the social registration. Can you please ask Kleo support to see if there a hook fired after user creation.Thank you
BrajeshBrajesh,
I switched from using the built in Kleo Facebook login to using WordPress Social Login – the one you mentioned. It is better so I’m hoping you can provide the modifications with that in mind.
Thanks,
Patrick
Hi Patrick,
Thank you.I will supply you with the code for it then.
Thank you
BrajeshThanks Brajesh,
When do you expect to have the modifications ready?
Regards,
Patrick
Hi Patrick,
I am sorry for the delay. It’s coming today.Regards
BrajeshHi Patrick,
I have pushed an update now.
Please upgrade to 1.1.2. It contains following updates:-
1. You can set default member type for the profile field
2. Fix the issue with multi select when none was selected.
3. Update the field generated html structure to match that of BuddyPress 2.9Also, Please put this code in your bp-custom.php
/** * Set member type when a user registers via the WordPress Social login. * @param int $user_id new user id. */ function buddydev_set_membertype_on_social_register( $user_id ) { $member_type = 'some_member_type_name';// please change it to valid member type. bp_set_member_type( $user_id, $member_type ); } add_action( 'wsl_hook_process_login_after_wp_insert_user', 'buddydev_set_membertype_on_social_register', 0 );
Make sure to change the $member_type to correct member type and It will assign the member type to users when they register via social login.
Hope that helps.
Regards
BrajeshBrajesh,
I installed the new version and the code and it appears to work perfectly! Thank you for the great support.
Best,
Pat
The topic ‘ [Resolved] Buddypress Member Types Pro Default Check’ is closed to new replies.