Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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/
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter( 'FHEE__EE_Export__report_registrations__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;
}
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter( 'FHEE__EE_Export__report_registrations__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
You can’t perform that action at this time.