Created
March 9, 2023 18:54
-
-
Save dparker1005/b2707cd9c7f4de6a9c6504c99468db40 to your computer and use it in GitHub Desktop.
Redirect users from the cancellation page to the Stripe Customer Portal.
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... | |
/** | |
* Prevent users from cancelling their membership or checking out for a new one. | |
*/ | |
function my_pmpro_redirect_cancel_to_stripe() { | |
global $pmpro_pages; | |
if ( ! empty( $pmpro_pages['cancel'] ) && is_page( $pmpro_pages['cancel'] ) ) { | |
PMProGateway_stripe::pmpro_billing_preheader_stripe_customer_portal(); | |
} | |
} | |
add_action('template_redirect', 'my_pmpro_redirect_cancel_to_stripe', 5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment