Hi Mohammad,
Thank you.Looks like
arm_after_add_new_user
Is the correct hook. I will post a solution with it today and then you can check and see if it works.
Regards
BrajeshHi Mohammad,
Sorry, I kept you waiting for such a long time.Please use the updated code
function buddydev_assign_member_type_on_registration( $user_id, $data ) { // replace =gender with your field name $gender = isset( $data['gender'] ) ? $data['gender'] : ''; if ( ! empty( $gender ) ) { if ( 'male' == $gender ) { bp_set_member_type( $user_id, 'member_type_name' ); // please change member type with valid member type. } elseif ( 'female' == $gender ) { bp_set_member_type( $user_id, 'member_type_name' ); // please change member type with valid member type. } } } add_action( 'arm_after_add_new_user', 'buddydev_assign_member_type_on_registration', 10, 2 );
Please make sure to change the member_type_name with appropriate member types(The unique name/key) as registered.
Also, if it does not work in bp-custom.php, please put it in your theme’s functions.php
Please let me know how it goes.
Regards
Brajesh
You must be logged in to reply to this topic.
This topic is: not resolved