I am working on a plugin and would like to check the users role before a certain action. I know I can use current_user_can() but this requires a checking against something like "edit_post" which works fine if only used from the code side. I however want the admin to be able to select a role from a drop down (like the current user role drop down on the user page) and then check against that role.
Something like:
if(user_role()=="editor"){//do something }
This should be less confusing. I know that older versions of WordPress used user roles as numbers with admin being 10 I think this has been depreciated.
Any Help would be great,
Brooke