You are here

public function CleantalkCheckUsersForm::cleantalk_delete_all_spammers_users in Anti Spam by CleanTalk 8.3

Same name and namespace in other branches
  1. 8.4 src/Form/CleantalkCheckUsersForm.php \Drupal\cleantalk\Form\CleantalkCheckUsersForm::cleantalk_delete_all_spammers_users()
  2. 9.1.x src/Form/CleantalkCheckUsersForm.php \Drupal\cleantalk\Form\CleantalkCheckUsersForm::cleantalk_delete_all_spammers_users()

File

src/Form/CleantalkCheckUsersForm.php, line 209

Class

CleantalkCheckUsersForm

Namespace

Drupal\cleantalk\Form

Code

public function cleantalk_delete_all_spammers_users(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
  $post_array = str_replace('delete_all_', '', $form_state
    ->getTriggeringElement()['#name']);
  $ids = explode('_', $post_array);
  foreach ($ids as $id) {
    user_cancel(array(), $id, 'user_cancel_delete');
  }
}