Last active
December 2, 2020 15:39
-
-
Save Pebblo/09081bb43fa217b0e83060d151d3eda2 to your computer and use it in GitHub Desktop.
Example of how to include the event categories within the registrations csv output.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Please do not add the opening PHP tag if you already have one. | |
function ee_tw_event_categories_to_csv( $reg_csv_array, $reg_row ) { | |
$EVT_ID = $reg_row['Registration.EVT_ID']; | |
$terms = array(); | |
$event_categories = get_the_terms( $EVT_ID, 'espresso_event_categories' ); | |
if ( $event_categories ) { | |
foreach( $event_categories as $term ) { | |
$terms[] = $term->name; | |
} | |
$terms = implode( ', ', $terms); | |
} | |
$reg_csv_array['Event Categories'] = !empty($terms) ? $terms : null; | |
return $reg_csv_array; | |
} | |
add_filter( 'FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__reg_csv_array', 'ee_tw_event_categories_to_csv', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment