I built up a membership site and i want only user can login if they have any of these user roles: administrator, tutor_instructor and club_members.
Could you please advise.
Thank you.
I built up a membership site and i want only user can login if they have any of these user roles: administrator, tutor_instructor and club_members.
Could you please advise.
Thank you.
2
Answers
The easiest way would be to use a custom code snippet or plugin with some custom code.
During the login process check the user role and redirect/logout.
Flow
Login > Check user role > If correct > redirect to membership page > else logout and redirect to membership sign up?. Though ideally, you shouldn’t have any users signed up without the correct roles anyway.
You could try using what’s available on the plugin repository.
If the plugin does not work, a small functions.php snippet should do the job (try clicking the first 10 links in that second bullet).