pass WC_Payment_Gateways instance to wc_payment_gateways_initialized hook
This commit is contained in:
parent
665a6ce721
commit
bbdbb026ea
|
@ -123,8 +123,10 @@ class WC_Payment_Gateways {
|
||||||
* Hook that is called when the payment gateways have been initialized.
|
* Hook that is called when the payment gateways have been initialized.
|
||||||
*
|
*
|
||||||
* @since 8.5.0
|
* @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
|
* @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 ) {
|
foreach ( $this->payment_gateways as $gateway ) {
|
||||||
$option_key = $gateway->get_option_key();
|
$option_key = $gateway->get_option_key();
|
||||||
self::add_action( 'add_option_' . $option_key, array( $this, 'payment_gateway_settings_option_changed' ), 10, 2 );
|
self::add_action( 'add_option_' . $option_key, array( $this, 'payment_gateway_settings_option_changed' ), 10, 2 );
|
||||||
|
|
Loading…
Reference in New Issue