function comment_confirm_delete

Form constructor for the confirmation form for comment deletion.

Parameters

Drupal\comment\Comment $comment: The comment that is about to be deleted.

See also

comment_confirm_delete_page()

comment_confirm_delete_submit()

confirm_form()

Related topics

1 string reference to 'comment_confirm_delete'
comment_confirm_delete_page in drupal/core/modules/comment/comment.admin.inc
Page callback: Shows a confirmation page for comment deletions.

File

drupal/core/modules/comment/comment.admin.inc, line 289
Admin page callbacks for the Comment module.

Code

function comment_confirm_delete($form, &$form_state, Comment $comment) {
  $form_state['comment'] = $comment;

  // Always provide entity id in the same form key as in the entity edit form.
  $form['cid'] = array(
    '#type' => 'value',
    '#value' => $comment
      ->id(),
  );
  return confirm_form($form, t('Are you sure you want to delete the comment %title?', array(
    '%title' => $comment->subject->value,
  )), 'node/' . $comment->nid->target_id, t('Any replies to this comment will be lost. This action cannot be undone.'), t('Delete'), t('Cancel'), 'comment_confirm_delete');
}