Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
Last active February 13, 2023 14:41
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 jesseeproductions/065e792824fe5133861164ef0de00cef to your computer and use it in GitHub Desktop.
Save jesseeproductions/065e792824fe5133861164ef0de00cef to your computer and use it in GitHub Desktop.
Adds a custom field to the attendee details sent to Zapier through Event Automator
/**
* Adds a custom field to the attendee details sent to Zapier through Event Automator.
* Replace %%CUSTOMFIELD%% with your field name.
*
* @since 1.0.0
*
* @param array<string|mixed> An array of attendee mapped details.
* @param array<string|mixed> An array of raw attendee details.
*/
function tec_automator_map_attendee_details( array $next_attendee, array $attendee ) {
$custom_field = get_post_meta( $attendee['attendee_id'], '%%CUSTOMFIELD%%', true );
if ( ! $custom_field ) {
return $next_attendee;
}
$next_attendee['%%CUSTOMFIELD%%'] = $custom_field;
return $next_attendee;
}
add_filter( 'tec_automator_map_attendee_details', 'tec_automator_attendee_add_custom_field', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment