You are here

function _webform_delete_component in Webform 7.4

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

Delete operation for a component or submission.

Parameters

$component: A Webform component array.

$value: An array of information containing the submission result, directly correlating to the webform_submitted_data database schema.

Related topics

File

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

Code

function _webform_delete_component($component, $value) {

  // Delete corresponding files when a submission is deleted.
  if (!empty($value[0]) && ($file = webform_get_file($value[0]))) {
    file_usage_delete($file, 'webform');
    file_delete($file);
  }
}