comment_multiple_delete_confirm_submit

Definition

comment_multiple_delete_confirm_submit($form, &$form_state)
drupal/modules/comment/comment.admin.inc, line 227

Description

Process comment_multiple_delete_confirm form submissions.

Code

function comment_multiple_delete_confirm_submit($form, &$form_state) {
  if ($form_state['values']['confirm']) {
    foreach ($form_state['values']['comments'] as $cid => $value) {
      $comment = comment_load($cid);
      // Perform the actual comment deletion.
      _comment_delete_thread($comment);
      _comment_update_node_statistics($comment->nid);
    }
    cache_clear_all();
    drupal_set_message(t('The comments have been deleted.'));
  }
  $form_state['redirect'] = 'admin/content/comment';
}