I’m trying to create custom csv report by modifying an existing one.
This code is suggested in multiple places of this forum, but I have problems adding new columns to it. It shows only those 3 columns. What’s the correct syntax for adding new columns, including custom columns e.g. data from user’s profile.
add_filter( ‘FHEE__EE_Export__report_registrations__reg_csv_array’, ‘espresso_reg_report_filter_columns’, 10, 2);
function espresso_reg_report_filter_columns( $csv_row, $registration_db_row ) {
$filtered_csv_row = array_intersect_key(
$csv_row,
array_flip(
array(
__( ‘First Name[ATT_fname]’, ‘event_espresso’ ),
__( ‘Last Name[ATT_lname]’, ‘event_espresso’ ),
__( ‘Email Address[ATT_email]’, ‘event_espresso’ ),
‘radio’,
//custom question’s admin label, doesn’t need to be translated. note though: if you ever change the custom question’s admin label, this code will need to be adjusted
)
)
);
The above snippet adds the Attendee first name to the CSV report, but it already has that data anyway?
If you can provide more details on what you are trying to do we may be able to help you further.
Viewing 3 reply threads
The support post ‘Custom registrations csv report’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.