I have searched the net for explanations, but I only find my own question without any real answer. Like this one: Adding multiple user roles dynamically
I need to dynamically assign more than one role to some users. However, it seems that WordPress core is built for only one role per user. I have used Members plugin to define more roles. And they seem to reside in wp_options, along with the 'native' ones. But it seems impossible to update the user->role with an array.
Any suggestions?
I have searched the net for explanations, but I only find my own question without any real answer. Like this one: Adding multiple user roles dynamically
I need to dynamically assign more than one role to some users. However, it seems that WordPress core is built for only one role per user. I have used Members plugin to define more roles. And they seem to reside in wp_options, along with the 'native' ones. But it seems impossible to update the user->role with an array.
Any suggestions?
Roles are assigned one per user. That's default for WordPress. Instead of using roles, I recommend using capabilities to keep track of different types of users. You can assign multiple capabilities per user and set some default capabilities for the role.
See: add_cap()
and remove_cap()