Last active
May 4, 2022 10:11
-
-
Save GeoffEW/25e98c2dddac3d67a02d2e8e4c8da813 to your computer and use it in GitHub Desktop.
Restores meta field and ticket # in CSV export for ET+ and ET
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 | |
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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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. 👍