How to check if a user is in a specific role?

Question

I have a pretty specific requirement to show different text in a field label on the user profile page based on the current user’s role. I can’t seem to figure out how to check whether the current use is an “author”.

I am looking for a function like:

is_user_in_role($user, "author");

I imagine this is pretty simple, but I have searched for too long without an answer so I thought I would post it here.

0
, , jessegavin 1 year 2020-07-27T02:23:01-05:00 0 Answers 50 views 0

Leave an answer

Browse
Browse