Last active
September 19, 2024 12:45
-
-
Save ipokkel/475243b635ce7ace89588852e0169f4e to your computer and use it in GitHub Desktop.
Force remove Stripe billing fields on checkout and billing
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 // Do NOT copy this line | |
function hide_address_on_billing_update_if_stripe() { | |
global $pmpro_pages, $gateway; | |
// Bail if necessary | |
if ( empty( $pmpro_pages ) || ( ! is_page( $pmpro_pages['checkout'] ) && ! is_page( $pmpro_pages['billing'] ) ) ) { | |
return; | |
} | |
// Filter out Stripe billing fields | |
if ( ! empty( $gateway ) && 'stripe' === $gateway ) { | |
add_filter( 'pmpro_include_billing_address_fields', '__return_false' ); | |
} | |
} | |
add_action( 'wp_head', 'hide_address_on_billing_update_if_stripe' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment