From fbd06019b140a12c310c45a28aa4a9248ff5a904 Mon Sep 17 00:00:00 2001 From: roykho Date: Fri, 4 May 2018 09:34:37 -0700 Subject: [PATCH] Remove payment methods as links in payment settings for WC 3.4+ --- readme.txt | 1 + woocommerce-gateway-stripe.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 1abcdc95c..006319c34 100644 --- a/readme.txt +++ b/readme.txt @@ -108,6 +108,7 @@ If you get stuck, you can ask for help in the Plugin Forum. * Fix - WC 2.6 compatibility issue during a refund. * Fix - Payment Request JS error when default country setting is not supported. * Fix - Failed payments were sending two failed emails to admin instead of one. +* Tweak - Remove payment methods links from WC Payment Settings page for WC 3.4+. = 4.1.2 - 2018-04-23 = * Fix - When payment method is invalid while trying to force save card, unexpected error can occur. diff --git a/woocommerce-gateway-stripe.php b/woocommerce-gateway-stripe.php index 32a151204..b85cb63d7 100644 --- a/woocommerce-gateway-stripe.php +++ b/woocommerce-gateway-stripe.php @@ -141,7 +141,10 @@ public function init() { add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateways' ) ); add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) ); - add_filter( 'woocommerce_get_sections_checkout', array( $this, 'filter_gateway_order_admin' ) ); + + if ( version_compare( WC_VERSION, '3.4', '<' ) ) { + add_filter( 'woocommerce_get_sections_checkout', array( $this, 'filter_gateway_order_admin' ) ); + } } /**