What happens if i assign let's say 2 different (custom) roles to a user that both of which have the same (custom) capability?
-
user will have all the capabilities. Why would you want to do this in the first place you should just make one custom role with all the capabilities needed to avoid confusion.– Jacob RamboFeb 14, 2014 at 16:27
-
1@JacobRambo : it seems quite reasonable to me to have Roles share capabilities.– s_ha_dumFeb 14, 2014 at 16:52
-
That seems reasonable to me too. But the OP is asking about assigning a user multiple roles. What would be the need for a user to have more than one role? I didn't even think that it was possible by default to do that in wordpress.– Jacob RamboFeb 14, 2014 at 17:06
-
If you understand "Roles" as "groupings of capabilities" which is the only way they make sense to me, then it is not hard to imagine wanting to put someone in two different groups.– s_ha_dumFeb 14, 2014 at 18:45
1 Answer
I am pretty sure that nothing would happen other than the user would have the capability in question.
Think about it. The default Roles share many capabilities-- Authors, Editors, and Administrators all have edit_posts
, for example. All roles (usually) have read
The same system manages both default and custom roles/capabilities, so there really should be no problem.