Skip to content

Instantly share code, notes, and snippets.

@ericnicolaas
Last active September 3, 2021 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericnicolaas/13fdd5f6444433ee127b5b75a3118a9d to your computer and use it in GitHub Desktop.
Save ericnicolaas/13fdd5f6444433ee127b5b75a3118a9d to your computer and use it in GitHub Desktop.
Add columns to Gift Aid export
add_filter(
'charitable_giftaid_export_row',
function( $row ) {
return array(
'donation_id' => $row['donation_id'] ?? '',
'title' => $row['title'] ?? '',
'first_name' => $row['first_name'] ?? '',
'last_name' => $row['last_name'] ?? '',
'house_number' => $row['house_number'] ?? '',
'postcode' => $row['postcode'] ?? '',
'agg_donations' => '',
'sponsored_event' => '',
'date' => $row['date'] ?? '',
'amount' => $row['amount'] ?? '',
'status' => $row['status'] ?? '',
);
}
);
add_filter(
'charitable_giftaid_export_entries_columns',
function() {
return array(
'donation_id' => __( 'Donation ID', 'charitable-gift-aid' ),
'title' => __( 'Title', 'charitable-gift-aid' ),
'first_name' => __( 'First name', 'charitable-gift-aid' ),
'last_name' => __( 'Last name', 'charitable-gift-aid' ),
'house_number' => __( 'House name or number', 'charitable-gift-aid' ),
'postcode' => __( 'Postcode', 'charitable-gift-aid' ),
'agg_donations' => 'Aggregated donations',
'sponsored_event' => 'Sponsored event',
'date' => __( 'Donation date', 'charitable-gift-aid' ),
'amount' => __( 'Amount', 'charitable-gift-aid' ),
'status' => __( 'Status', 'charitable-gift-aid' ),
);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment