You are here

function better_comments_confirm_delete_submit in Better Comments 7

Same name and namespace in other branches
  1. 7.2 better_comments.module \better_comments_confirm_delete_submit()

Delete the comment by calling comment_delete.

1 string reference to 'better_comments_confirm_delete_submit'
better_comments_form_comment_confirm_delete_alter in ./better_comments.module
Implements hook_form_FORM_ID_alter().

File

./better_comments.module, line 314
Better Comments provides option to configure the comment system.

Code

function better_comments_confirm_delete_submit(&$form, &$form_state) {
  form_load_include($form_state, 'inc', 'comment', 'comment.admin');
  $comment = $form['#comment'];

  // Delete the comment and its replies.
  comment_delete($comment->cid);
  watchdog('content', 'Deleted comment @cid and its replies.', array(
    '@cid' => $comment->cid,
  ));
  $commands[] = ajax_command_remove('#comment-wrap-' . $comment->cid);
  return array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
}