From 495475db134991e140708090d4950148b4448aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?berislav=20grgi=C4=8Dak?= Date: Wed, 15 Nov 2023 11:30:12 +0100 Subject: [PATCH] Marketplace connection deny redirect (#41398) * Redirect connect deny to correct subscriptions page * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions --- .../changelog/41398-fix-connect-deny-redirect | 4 ++++ .../includes/admin/helper/class-wc-helper.php | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 plugins/woocommerce/changelog/41398-fix-connect-deny-redirect diff --git a/plugins/woocommerce/changelog/41398-fix-connect-deny-redirect b/plugins/woocommerce/changelog/41398-fix-connect-deny-redirect new file mode 100644 index 00000000000..cb2a7d4b006 --- /dev/null +++ b/plugins/woocommerce/changelog/41398-fix-connect-deny-redirect @@ -0,0 +1,4 @@ +Significance: patch +Type: fix +Comment: Fix marketplace connection deny redirects. + diff --git a/plugins/woocommerce/includes/admin/helper/class-wc-helper.php b/plugins/woocommerce/includes/admin/helper/class-wc-helper.php index 7098929c95e..1d46774e267 100644 --- a/plugins/woocommerce/includes/admin/helper/class-wc-helper.php +++ b/plugins/woocommerce/includes/admin/helper/class-wc-helper.php @@ -788,7 +788,16 @@ class WC_Helper { * Fires when the Helper connection process is denied/cancelled. */ do_action( 'woocommerce_helper_denied' ); - wp_safe_redirect( admin_url( 'admin.php?page=wc-addons§ion=helper' ) ); + + wp_safe_redirect( + self::get_helper_redirect_url( + array( + 'page' => 'wc-addons', + 'section' => 'helper', + ), + isset( $_GET['redirect-to-wc-admin'] ) + ) + ); die(); }