Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Set up custom CSV Export to match the ordering of the client's current csv and filter out extraneous columns
- function tw_ee_espresso_reg_report_filter_columns_ordered( $csv_row, $registration_db_row ) {
- //Set the allowed fields here and also set them in the order you want them to be displayed within the CSV
- $allowed_fields_in_order = array(
- __( 'Registration ID', 'event_espresso' ) . '[REG_ID]',
- __( 'Event', 'event_espresso' ),
- __( 'affiliated-membership', 'event_espresso' ),
- __( 'Ticket Name', 'event_espresso' ),
- __( 'First Name', 'event_espresso' ) . '[ATT_fname]',
- __( 'middle_initial', 'event_espresso' ),
- __( 'Last Name', 'event_espresso' ) . '[ATT_lname]',
- __( 'Email Address', 'event_espresso' ) . '[ATT_email]',
- __( 'county_official', 'event_espresso' ),
- __( 'county', 'event_espresso' ),
- __( 'title', 'event_espresso' ),
- __( 'employer', 'event_espresso' ),
- __( 'departmentdivision', 'event_espresso' ),
- __( 'gluten-free', 'event_espresso' ),
- __( 'vegetarian', 'event_espresso' ),
- __( 'vegan', 'event_espresso' ),
- __( 'authorizing_name', 'event_espresso' ),
- __( 'authorizing_title', 'event_espresso' ),
- __( 'authorizing_email', 'event_espresso' ),
- __( 'Address Part 1', 'event_espresso' ) . '[ATT_address]',
- __( 'Address Part 2', 'event_espresso' ) . '[ATT_address2]',
- __( 'City', 'event_espresso' ) . '[ATT_city]',
- __( 'State', 'event_espresso' ) . '[STA_ID]',
- __( 'Country', 'event_espresso' ) . '[CNT_ISO]',
- __( 'ZIP/Postal Code', 'event_espresso' ) . '[ATT_zip]',
- __( 'Phone', 'event_espresso' ) . '[ATT_phone]',
- __( 'cell_number', 'event_espresso' ),
- __( 'fax', 'event_espresso' ),
- __( 'comments', 'event_espresso' ),
- __( 'Registration's share of the transaction total', 'event_espresso' ) . '[REG_final_price]',
- __( 'Amount Paid', 'event_espresso' ),
- __( 'Registration Status', 'event_espresso' ),
- __( 'Time registration occurred', 'event_espresso' ) . '[REG_date]',
- );
- //Sets $filtered_csv_row to only contain the 'allowed' fields.
- $filtered_csv_row = array_intersect_key(
- $csv_row,
- array_flip( $allowed_fields_in_order )
- );
- //Now lets set $filtered_csv_row to use the same custom order we set $allowed_fields_in_order to
- $filtered_csv_row = array_merge(array_flip($allowed_fields_in_order), $filtered_csv_row );
- return $filtered_csv_row;
- }
- add_filter( 'FHEE__EE_Export__report_registrations__reg_csv_array', 'tw_ee_espresso_reg_report_filter_columns_ordered', 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement