Cannot export CUSTOM donor data.
-
This question is related to custom/extra fields on the donation forms (donor AND donation meta), doing this in code (not form manager)
I have got working:
– custom fields in donor/donation part show in DONATION form correctly
– fields required show error when not filled and donate pressed
– custom fields end up in database (phpMyAdmin)
for both donor and donation meta CORRECTLY
– tick boxes show up in the export pages (donor/donation)
– per donation custom fields SHOW up in CSV
– so it’s MOST bar 1
I do not have working:
– per donor custom fields do NOT show up in CSV
I have followed documention:
https://github.com/impress-org/givewp-snippet-library/blob/master/donors/add-donor-meta.php
https://github.com/impress-org/givewp-snippet-library/blob/master/form-customizations/custom-fields-plugin.php
https://givewp.com/documentation/developers/how-to-create-custom-form-fields/
The problem:
The problem is the hook ‘give_export_set_donor_data’ is never called, the “here i am” never shows up in the PHP log.add_filter( 'give_export_set_donor_data', 'give_export_set_custom_donor_data', 10, 2 ); function give_export_set_custom_donor_data( $data, $donor ) { error_log("here i am"); $phone_number = Give()->donor_meta->get_meta( $donor->id, 'give_phone', true ); $data['phone_number'] = ! empty( $phone_number ) ? $phone_number : '- N/A - '; return $data; }
What am I doing wrong?
- The topic ‘Cannot export CUSTOM donor data.’ is closed to new replies.