WordPress filter hook

wc_payment_gateway_payment_type_to_name

Fired by 3 WordPress plugins, running on 81K+ sites between them.

“Payment Gateway Type to Name Filter.”

How to use wc_payment_gateway_payment_type_to_name

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wc_payment_gateway_payment_type_to_name', function( $name, $type ) {
	// Change $name here.
	return $name;
}, 10, 2 );

Argument names come from WooCommerce Square's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

3 plugins that fire wc_payment_gateway_payment_type_to_name

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce Square icon WooCommerce Square80,000+ installs apply_filters( 'wc_payment_gateway_payment_type_to_name', $name, $type ) includes/Framework/PaymentGateway/Payment_Gateway_Helper.php:197
  2. XL NMI Gateway for WooCommerce icon XL NMI Gateway for WooCommerce800+ installs apply_filters( 'wc_payment_gateway_payment_type_to_name', $name, $type ) lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:206
  3. Ultimo Woocommerce Email Plugin icon Ultimo Woocommerce Email Plugin10+ installs apply_filters( 'wc_payment_gateway_payment_type_to_name', $name, $type ) tools/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:211

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.