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 out the registration form. In this tutorial, I am showing how you will add the user role field as a radio/checkbox field type in your existing registration form (which was made with the Fluent Forms plugin) and save it into the user’s 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.
$20.00Pay Now
* Payment is non-refundable.
Paid members will be able to login below to see the restricted content.
Login
In Code: 14 is my FF user registration form ID. You would replace it with your form ID. user_role is my User Role’s radio field name. You would replace it with your field name if you are using a different name. You will copy the above code and paste it into your active theme’s functions.php file.
Now follow the video for field settings.
Reviews
There are no reviews yet.