Skip to content

Instantly share code, notes, and snippets.

@paulmist
Forked from Pebblo/example.php
Created February 13, 2025 11:39
Show Gist options
  • Save paulmist/a5351a834be9b88cad7f16ae8e4d69ea to your computer and use it in GitHub Desktop.
Save paulmist/a5351a834be9b88cad7f16ae8e4d69ea to your computer and use it in GitHub Desktop.
This function sets the Registration CSV report to only export primary registrants.
<?php //Please do not include the opening PHP tag if you already have one
function tw_ee_only_export_primary_registrants($reg_csv_array, $reg_row) {
//Only export the primary registrants
if( $reg_row['Registration.REG_count'] !== '1' ) {
return array();
}
//Include the REG_Group_Size column so you can see how many tickets purchased.
$reg_csv_array['Group Size'] = $reg_row['Registration.REG_group_size'];
return $reg_csv_array;
}
add_filter( 'FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__reg_csv_array', 'tw_ee_only_export_primary_registrants', 100, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment