Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mircobabini/badc966f58182164dfcdf7c33c3f44f1 to your computer and use it in GitHub Desktop.
Save mircobabini/badc966f58182164dfcdf7c33c3f44f1 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'pmpro_include_billing_address_fields', function ( $include ) {
// if someone forced to include the fields
// but it's set to NOT include them in settings
// and Stripe Checkout is active
// and Stripe Checkout is set to include billing address fields on its checkout page
// => don't include them, bc it's a conflict with some other add-on or snippet
if ( $include && ! pmpro_getOption( "stripe_billingaddress" ) && 'checkout' === pmpro_getOption( 'stripe_payment_flow' ) && pmpro_getOption( 'stripe_checkout_billing_address' ) ) {
$include = false;
}
return $include;
}, 1000000000 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment