Description
Checks if a user has a given role or not.
Parameters
$role
(mixed) (required) The role or array of roles being checked.
$user_id
(integer) (optional) The user ID to check. If no user ID is given, the current user is checked. (Default: false)
Return Value
boolean (true|false) If the user has the role checked, true is returned, otherwise false.
Examples
Changelog
Introduced in version 3.1.1
Can check array of roles or single string in 3.1.6
Source
wpmem_user_has_role() is located in /includes/api-users.php.