Created
July 12, 2021 14:14
-
-
Save Pebblo/9053b0c939f039e3d97dd1de558fd18d to your computer and use it in GitHub Desktop.
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 //Do not include the opening PHP tag if you already have one. | |
add_filter('FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__get_filename', 'tw_ee_filter_RegistrationsReport__get_filename', 10); | |
function tw_ee_filter_RegistrationsReport__get_filename( $filename ) { | |
if( !empty($_REQUEST['EVT_ID'])) { | |
$event = EEM_Event::instance()->get_one_by_ID( absint($_REQUEST['EVT_ID']) ); | |
if( $event instanceof EE_Event ) { | |
return sprintf( | |
"event-espresso-registrations-{$event->slug()}-%s.csv", | |
str_replace(array(':', ' '), '-', current_time('mysql')) | |
); | |
} | |
} | |
return $filename; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment