Last active
July 5, 2019 17:40
-
-
Save joshfeck/4a7f576ea04a7d43be05 to your computer and use it in GitHub Desktop.
from http://eventespresso.com/topic/export-custom-fields/ You can add this code to a functions plugin or into your WordPress theme's functions.php file. More info here: http://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
add_filter( | |
'FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__reg_csv_array', | |
'espresso_add_meta_value_csv', | |
10, | |
2 | |
); | |
function espresso_add_meta_value_csv( $reg_csv_array, $reg_row ) { | |
// get the event's ID | |
$event_id = $reg_row[ 'Registration.EVT_ID' ]; | |
// example of getting the post meta | |
$room_number = get_post_meta( $event_id, 'room_number', true ); | |
if ( $room_number != '' ) { | |
$reg_csv_array[ 'Room Number' ] = $room_number; | |
} | |
return $reg_csv_array; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
add_filter( | |
'FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__reg_csv_array', | |
'espresso_add_paypal_id_csv', | |
10, | |
2 | |
); | |
function espresso_add_paypal_id_csv( $reg_csv_array, $reg_row ) { | |
// get the event's ID | |
$event_id = $reg_row[ 'Registration.EVT_ID' ]; | |
// example of getting the post meta | |
$paypal_id = get_post_meta( $event_id, 'paypal_item_id', true ); | |
if ( $paypal_id != '' ) { | |
$reg_csv_array[ 'PayPal ID' ] = $paypal_id; | |
} | |
return $reg_csv_array; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment