Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created July 12, 2021 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/9053b0c939f039e3d97dd1de558fd18d to your computer and use it in GitHub Desktop.
Save Pebblo/9053b0c939f039e3d97dd1de558fd18d to your computer and use it in GitHub Desktop.
<?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