1 node.pages.inc node_delete_confirm_submit($form, &$form_state)

Form submission handler for node_delete_confirm().

See also

node_delete_confirm()

File

core/modules/node/node.pages.inc, line 848
Callbacks for adding, editing, and deleting content and managing revisions.

Code

function node_delete_confirm_submit($form, &$form_state) {
  if ($form_state['values']['confirm']) {
    $node = node_load($form_state['values']['nid']);
    node_delete($form_state['values']['nid']);
    watchdog('content', '@type: deleted %title.', array('@type' => $node->type, '%title' => $node->title));
    backdrop_set_message(t('@type %title has been deleted.', array('@type' => node_type_get_name($node), '%title' => $node->title)));
  }

  $form_state['redirect'] = '<front>';
}