I’ve set 2 new roles for my site using the “Members” plugin – “sellers” and “buyers”.
Each role should have its own registration page and login.
A visitor can register as both a buyer and a seller but he can only be logged in as one of them.
So, if a visitor has logged in as a seller and then goes to the buyer page he’ll be able to login as a buyer and when he does so he will automatically be logged out as a seller.
I’ve searched for hours for a plugin that will give me the option to do this but couldn’t find one.
Sounds like a pretty common configuration in websites with different role registrations.
Does a plugin such as this even exist?
And if not how can this be done?
Creating two separate registration for different roles is easy:
and now you can link each role with “its own” registration form:
but as Milo commented:
which means that they would have to use a different email to register the other role.
Update
this is an update with an example to show how you can use the same fore but with different fields for each role.
So you just need to change the functions a bit:
this way only the fields needed by the specific role are shown.
Next is if you want to have some kind of validation to these extra fields you can use
register_post
hook for example:then if every thing is fine just save the fields in the user meta based on the role