How to get the role of current user in WordPress?

Posted by Prem Tiwari | Updated on

Want to get the role of current user in WordPress? I’m assuming you know what hooks of WordPress you want to use. So skipping that part, it’s pretty easy to get the current role of the user.

You can use current_user_can to look for specific capabilities, if you just want to check whether or not a user has a specific permission versus whether or not they’re in the role. For example:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers