Skip to content

Instantly share code, notes, and snippets.

@GeoffEW
Last active May 4, 2022 10:11
Show Gist options
  • Save GeoffEW/25e98c2dddac3d67a02d2e8e4c8da813 to your computer and use it in GitHub Desktop.
Save GeoffEW/25e98c2dddac3d67a02d2e8e4c8da813 to your computer and use it in GitHub Desktop.
Restores meta field and ticket # in CSV export for ET+ and ET
<?php
function restore_ticket_csv_headers( $columns ) {
// Only meddle with the attendee csv export request
if ( ! isset( $_GET['attendees_csv'] ) ) return $columns;
// Tribe__Tickets__Tickets_Handler::instance() already owns an attendee
// table object but it is private and there is not currently an accessor
$attendees_table = new Tribe__Tickets__Attendees_Table();
// Add the expected/missing columns
return array_merge( $attendees_table->get_columns(), $columns );
}
add_filter( 'manage_tribe_events_page_tickets-attendees_columns', 'restore_ticket_csv_headers', 100 );
@Trippnology
Copy link

Geoff, you legend! Been bashing my head against CSV exporting for hours, and found this, which I didn't understand at first.

Added this to my theme and suddenly all the things I had been doing, worked as expected.

What a guy. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment