pass WC_Payment_Gateways instance to wc_payment_gateways_initialized hook

This commit is contained in:
Leif Singer 2023-11-24 11:13:44 +01:00
parent 665a6ce721
commit bbdbb026ea
1 changed files with 4 additions and 2 deletions

View File

@ -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 );