Created
January 2, 2022 00:41
-
-
Save ideadude/d8374759a0f62cee9a0800b93d2ee2a8 to your computer and use it in GitHub Desktop.
Add phone number to the data array sent to Zapier when a new PMPro order is made.
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 | |
/** | |
* Add phone number to the data array sent to Zapier | |
* when a new PMPro order is made. | |
* | |
* This gist requires the pmpro-zapier plugin. | |
* For information on how to add code snippets: https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/ | |
*/ | |
function my_pmproz_added_order_data_add_phone( $data, $order, $user_id ) { | |
$data['phonenumber'] = get_user_meta( $user_id, 'pmpro_bphone', true ); | |
return $data; | |
} | |
add_filter( 'pmproz_added_order_data', 'my_pmproz_added_order_data_add_phone', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment