Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active October 28, 2019 23:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/a4d95889cf4b9bfbe8d09e9eb9d8f590 to your computer and use it in GitHub Desktop.
Save joshfeck/a4d95889cf4b9bfbe8d09e9eb9d8f590 to your computer and use it in GitHub Desktop.
Remove database row labels from Regsitrations report CSV column headings
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_remove_db_labels_from_csv_column_headings(
$reg_csv_array,
$reg_row
) {
foreach ($reg_csv_array as $key => $value) {
unset($reg_csv_array[$key]);
$new_key = preg_replace('/\[[^\]]*]/', '', $key);
$reg_csv_array[$new_key] = $value;
}
return $reg_csv_array;
}
add_filter(
'FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__reg_csv_array',
'ee_remove_db_labels_from_csv_column_headings',
11,
2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment