Created
December 2, 2021 17:24
-
-
Save DumahX/f8c4a68e715745b730bf1055fce2cb74 to your computer and use it in GitHub Desktop.
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 | |
// Attach a phone number custom field when creating a Stripe Customer object. | |
// Replace mepr_phone_number with the actual slug of the phone number custom field in MemberPress. | |
function mepr_stripe_customer_extended_args($args, $user) { | |
$phone_number = trim(get_user_meta($user->ID, 'mepr_phone_number', true)); | |
if(!empty($phone_number)) { | |
$args['phone'] = $phone_number; | |
} | |
return $args; | |
} | |
add_filter('mepr_stripe_create_customer_args', 'mepr_stripe_customer_extended_args', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment