Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Created August 7, 2020 20:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dparker1005/d56367fbf3c2832bd577e176dcfdc697 to your computer and use it in GitHub Desktop.
Save dparker1005/d56367fbf3c2832bd577e176dcfdc697 to your computer and use it in GitHub Desktop.
Send extra fields to Zapier after PMPro checkout.
<?php
// Copy from below here...
/*
* Send extra fields to Zapier after PMPro checkout.
*/
function my_pmproz_after_checkout_data( $data, $user_id ) {
// Assuming 'first_name' and 'last_name' are fields on your PMPro checkout page.
if ( ! empty( $_REQUEST['first_name'] ) ) {
$data['first_name'] = $_REQUEST['first_name'];
}
if ( ! empty( $_REQUEST['last_name'] ) ) {
$data['last_name'] = $_REQUEST['last_name'];
}
return $data;
}
add_action( 'pmproz_after_checkout_data', 'my_pmproz_after_checkout_data', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment