You are here

function hook_webform_csv_header_alter in Webform 6.3

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

Alter a Webform submission's header when exported.

Related topics

1 invocation of hook_webform_csv_header_alter()
webform_results_export in includes/webform.report.inc
Generate a Excel-readable CSV file containing all submissions for a Webform.

File

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

Code

function hook_webform_csv_header_alter(&$header, $component) {

  // Use the machine name for component headers, but only for the webform
  // with node 5 and components that are text fields.
  if ($component['nid'] == 5 && $component['type'] == 'textfield') {
    $header[2] = $component['form_key'];
  }
}