You are here

function hook_webform_csv_header_alter in Webform 7.4

Same name and namespace in other branches
  1. 6.3 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_download_headers in includes/webform.report.inc
Print the header rows for the downloadable webform data.

File

./webform.api.php, line 412
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'];
  }
}