Use the woocommerce_bookings_export_row_data filter when several columns need to be adjusted together before the CSV row is written. This is useful for row-level transformations, derived values, or normalizing values from multiple fields at the same time. The snippet below uppercases the exported status and adds the booking ID explicitly to the row data.
add_filter(
'woocommerce_bookings_export_row_data',
function ( array $row, WC_Booking $booking ): array {
if ( isset( $row['status'] ) ) {
$row['status'] = strtoupper( (string) $row['status'] );
}
$row['booking_id'] = $booking->get_id();
return $row;
},
10,
2
);