public static function CleantalkFuncs::_cleantalk_user_has_role_id in Anti Spam by CleanTalk 7.4
Same name and namespace in other branches
- 7.5 src/CleantalkFuncs.php \CleantalkFuncs::_cleantalk_user_has_role_id()
1 call to CleantalkFuncs::_cleantalk_user_has_role_id()
- CleantalkFuncs::_cleantalk_check_spam in src/
CleantalkFuncs.php - Cleantalk inner function - performs antispam checking.
File
- src/
CleantalkFuncs.php, line 796
Class
- CleantalkFuncs
- Cleantalk class create request
Code
public static function _cleantalk_user_has_role_id($role_id, $user = NULL) {
if ($user == NULL) {
global $user;
}
if (is_array($user->roles) && in_array($role_id, array_keys($user->roles))) {
return TRUE;
}
return FALSE;
}