You are here

public static function CleantalkFuncs::cleantalk_get_user_roles_default in Anti Spam by CleanTalk 7.4

Same name and namespace in other branches
  1. 7.5 src/CleantalkFuncs.php \CleantalkFuncs::cleantalk_get_user_roles_default()
1 call to CleantalkFuncs::cleantalk_get_user_roles_default()
cleantalk_settings_form in src/Form/CleantalkSettingsForm.php
Cleantalk settings form.

File

src/CleantalkFuncs.php, line 814

Class

CleantalkFuncs
Cleantalk class create request

Code

public static function cleantalk_get_user_roles_default() {
  $roles = self::cleantalk_get_user_roles();
  foreach ($roles as $role_id => $role_name) {
    if (strpos('administrator', $role_name) === false) {
      unset($roles[$role_id]);
    }
  }
  return $default_roles = array_keys($roles);
}