Created
August 7, 2020 20:52
-
-
Save dparker1005/d56367fbf3c2832bd577e176dcfdc697 to your computer and use it in GitHub Desktop.
Send extra fields to Zapier after PMPro checkout.
This file contains 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 | |
// 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