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

To get user roles of currently logged in user and match it against a specific user role.

 

Leave a Reply

Your email address will not be published. Required fields are marked *


Notice: Use of undefined constant STOPSPAM_PLUGIN_VERSION - assumed 'STOPSPAM_PLUGIN_VERSION' in /home/webpilla/puneetk.com/wp-content/plugins/stop-spam/stop-spam.php on line 36

Notice: Use of undefined constant STOPSPAM_PLUGIN_VERSION - assumed 'STOPSPAM_PLUGIN_VERSION' in /home/webpilla/puneetk.com/wp-content/plugins/stop-spam/stop-spam.php on line 40