We create a user registration form with Fluent Forms’ User Registration module. We want that our visitors will select their own user role when they are filling the registration form. In this tutorial I am showing how you will add the user role field as radio/checkbox field type in your existing registration form (which made with Fluent Forms plugin) and save into the users table.
PHP Snippet: Saving the Selected Role in User Meta Table
The rest of the content is available for Pro members. Click on the PAY NOW button to enable access to this content.
* Payment is non-refundable.
In Code: 14 is my FF user registration form ID. You would replace it with yours form ID. user_role is my User Role’s radio field name. You would replace it with your field name if you are using the different name. You will copy the above code and paste into the your active theme’s functions.php file.
Now follow the video for field settings.