WordPress filter hook

woocommerce_credit_card_form_args

Fired by 5 WordPress plugins, running on 100+ sites between them.

How to use woocommerce_credit_card_form_args

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( 'woocommerce_credit_card_form_args', function( $default_args, $id ) {
	// Change $default_args here.
	return $default_args;
}, 10, 2 );

Argument names come from WC Authorize.net Payment Gateway's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

5 plugins that fire woocommerce_credit_card_form_args

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

  1. WC Authorize.net Payment Gateway icon WC Authorize.net Payment Gateway40+ installs apply_filters( 'woocommerce_credit_card_form_args', $default_args, $this->id ) wc-authorizenet-aim-payment-gateway.php:152
  2. Authorize.net for WooCommerce icon Authorize.net for WooCommerce30+ installs apply_filters( 'woocommerce_credit_card_form_args', $default_args, $this->id ) os-woocommerce-authorizenet-aim.php:152
  3. Woo Braintree Payment icon Woo Braintree Payment10+ installs apply_filters( 'woocommerce_credit_card_form_args', $default_args, $this->id ) include/woo-mynix-braintree.php:77
  4. First Data for WooCommerce icon First Data for WooCommerce10+ installs apply_filters( 'woocommerce_credit_card_form_args', $default_args, $this->id ) os-woocommerce-firstdata.php:168
  5. WC First Data Payment Gateway icon WC First Data Payment Gateway10+ installs apply_filters( 'woocommerce_credit_card_form_args', $default_args, $this->id ) wc-first-data-payment-gateway.php:168

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.