Hi @hebafarid
You can add a role field for users to select in the Register form. It’s not possible to add a role field in the Login form.
Regards,
So during login, how can I know the user currently logging in is of which type?
Also, When I added a role field for users to select in the Register form, not all roles where displayed. How can I select the roles that are going to be displayed?
Hi @hebafarid
1. >>> So during login, how can I know the user currently logging in is of which type?
– Are you trying to attach a code to the login process?
2. >>> also, When I added a role field for users to select in the Register form, not all roles are displayed. How can I select the roles that are going to be displayed?
– Unfortunately, there’s a security vulnerability issue when displaying all roles that have administrative capabilities that’s why we designed it to not display all roles. You will have to customize it at your expense.
Regards,
-
This reply was modified 5 years, 3 months ago by
Champ Camba.
Hello @champsupertramp
regarding my question “also, When I added a role field for users to select in the Register form, not all roles are displayed. How can I select the roles that are going to be displayed?”
There is an option in the roles drop-down box named “choices callback”, what does it mean and what is the value that it is exactly expecting?
@champsupertramp IF I added the choices in the code and it became in the drop-down list, will this solve the problem and now the plugin’s registration form support multiple user roles?
@champsupertramp I did what is in this link: https://docs.ultimatemember.com/article/1539-choices-callback-feature-in-um-2-1
regarding the country not the states. It didn’t work, nothing changed. The drop-down list still have one option only. I added the code using “code snippets” plugin.
Hi @hebafarid
Could you please provide the code you’ve so we can review them?
Regards,
Hello @champsupertramp
Here is my code:
function custom_umwoo_userRoles_list_dropdown() {
$roles = array(
“employer” => “Employer”,
“job-seeker” => “Subscriber”
);
return $roles;
}
and in the registration form in the roles drop-down menu in “Choices Callback” field I wrote “custom_umwoo_userRoles_list_dropdown”
Hi @hebafarid
Which role is shown and which is hidden?
Regards,
Hello @champsupertramp
“subscriber” is the only role shown. As, shown here :https://snipboard.io/eMZRCY.jpg
Hi @hebafarid
Could you please provide a screenshot of the “Employer” role settings?
Regards,
hello @champsupertramp
Where can I find that “the “Employer” role settings”?
Hi @hebafarid
Did you create the Employer role in WP Admin > Ultimate Member > User Roles?
Regards,