From 1e0cf3087ee1f0627c1390df0ff45766fdfb5a01 Mon Sep 17 00:00:00 2001 From: thenbrent Date: Fri, 1 Nov 2013 14:14:00 -0700 Subject: [PATCH] Redirect to My Account page after adding method Part of #3396 --- includes/class-wc-form-handler.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index aae1375d2bd..06dfea7caf0 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -305,13 +305,12 @@ class WC_Form_Handler { // Process if ( wc_error_count() == 0 ) { - $result = $available_gateways[ $payment_method ]->add_payment_method(); // Redirect to success/confirmation/payment page if ( $result['result'] == 'success' ) { - wp_redirect( $result['redirect'] ); - exit; + wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) ); + exit(); } }