Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function attendee_export_add_phone_split_name( $items ) {
- $count = 0;
- foreach ( $items as &$attendee_record ) {
- // Add the header columns
- if ( 1 === ++$count ) {
- $attendee_record[] = 'First Name';
- $attendee_record[] = 'Last Name';
- $attendee_record[] = 'Phone';
- }
- // Populate the new column in each subsequent row
- else {
- // order id is in the 6th index
- $order = wc_get_order( (int) $attendee_record[6] );
- $attendee_record[] = $order->billing_first_name;
- $attendee_record[] = $order->billing_last_name;
- $attendee_record[] = $order->billing_phone;
- }
- }
- return $items;
- }
- add_filter( 'tribe_events_tickets_attendees_csv_items', 'attendee_export_add_phone_split_name' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement