You are here

function node_form_delete_submit in Drupal 7

Same name and namespace in other branches
  1. 6 modules/node/node.pages.inc \node_form_delete_submit()

Form submission handler for node_form().

Handles the 'Delete' button on the node form.

See also

node_form()

node_form_validate()

1 string reference to 'node_form_delete_submit'
node_form in modules/node/node.pages.inc
Form constructor for the node add/edit form.

File

modules/node/node.pages.inc, line 338
Page callbacks for adding, editing, deleting, and revisions management for content.

Code

function node_form_delete_submit($form, &$form_state) {
  $destination = array();
  if (isset($_GET['destination'])) {
    $destination = drupal_get_destination();
    unset($_GET['destination']);
  }
  $node = $form['#node'];
  $form_state['redirect'] = array(
    'node/' . $node->nid . '/delete',
    array(
      'query' => $destination,
    ),
  );
}