From bbdbb026ea623e9d3cc89a633455f694517f067b Mon Sep 17 00:00:00 2001 From: Leif Singer Date: Fri, 24 Nov 2023 11:13:44 +0100 Subject: [PATCH] pass WC_Payment_Gateways instance to wc_payment_gateways_initialized hook --- plugins/woocommerce/includes/class-wc-payment-gateways.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce/includes/class-wc-payment-gateways.php b/plugins/woocommerce/includes/class-wc-payment-gateways.php index 413f1c2e660..80b322998e5 100644 --- a/plugins/woocommerce/includes/class-wc-payment-gateways.php +++ b/plugins/woocommerce/includes/class-wc-payment-gateways.php @@ -123,8 +123,10 @@ class WC_Payment_Gateways { * Hook that is called when the payment gateways have been initialized. * * @since 8.5.0 + * + * @param WC_Payment_Gateways $wc_payment_gateways The payment gateways instance. */ - do_action( 'wc_payment_gateways_initialized' ); + do_action( 'wc_payment_gateways_initialized', $this ); } /** @@ -132,7 +134,7 @@ class WC_Payment_Gateways { * * @since 8.5.0 */ - public function on_payment_gateways_initialized() { + public function on_payment_gateways_initialized( WC_Payment_Gateways $wc_payment_gateways ) { foreach ( $this->payment_gateways as $gateway ) { $option_key = $gateway->get_option_key(); self::add_action( 'add_option_' . $option_key, array( $this, 'payment_gateway_settings_option_changed' ), 10, 2 );