You are here

function hook_webform_submission_delete in Webform 7.3

Same name and namespace in other branches
  1. 6.3 webform.api.php \hook_webform_submission_delete()
  2. 7.4 webform.api.php \hook_webform_submission_delete()

Respond to a Webform submission being deleted.

Parameters

$node: The Webform node on which this submission was made.

$submission: The Webform submission that was just deleted from the database.

Related topics

1 invocation of hook_webform_submission_delete()
webform_submission_delete in includes/webform.submissions.inc
Delete a single submission.

File

./webform.api.php, line 176
Sample hooks demonstrating usage in Webform.

Code

function hook_webform_submission_delete($node, $submission) {

  // Delete a record from a 3rd-party module table when a submission is deleted.
  db_delete('mymodule_table')
    ->condition('nid', $node->nid)
    ->condition('sid', $submission->sid)
    ->execute();
}