woocommerce_payment_gateway_enabled action-hookWC 10.7.0

Fires when a payment gateway has been enabled.

Used by WC_Email_Admin_Payment_Gateway_Enabled to send an admin notification email. This action is registered as a transactional email action in WC_Emails::init_transactional_emails(), which ensures WC_Emails is instantiated before the _notification variant is fired.

Usage

add_action( 'woocommerce_payment_gateway_enabled', 'wp_kama_woocommerce_payment_gateway_enabled_action' );

/**
 * Function for `woocommerce_payment_gateway_enabled` action-hook.
 * 
 * @param WC_Payment_Gateway $gateway The gateway that was enabled.
 *
 * @return void
 */
function wp_kama_woocommerce_payment_gateway_enabled_action( $gateway ){

	// action...
}
$gateway(WC_Payment_Gateway)
The gateway that was enabled.

Changelog

Since 10.7.0 Introduced.

Where the hook is called

WC_Payment_Gateways::payment_gateway_settings_option_changed()
woocommerce_payment_gateway_enabled
woocommerce/includes/class-wc-payment-gateways.php 197
do_action( 'woocommerce_payment_gateway_enabled', $gateway );

Where the hook is used in WooCommerce

Usage not found.