WordPress filter hook

woocommerce_credit_card_form_fields

Defined by WooCommerce and fired by 37 plugins in total, running on 7M+ sites between them.

How to use woocommerce_credit_card_form_fields

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

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

37 plugins that fire woocommerce_credit_card_form_fields

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

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/gateways/class-wc-payment-gateway-cc.php:82
  2. PagBank for WooCommerce icon PagBank for WooCommerce4,000+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) src/core/Gateways/CreditCardPaymentGateway.php:691
  3. CHIP for WooCommerce icon CHIP for WooCommerce4,000+ installs apply_filters( 'woocommerce_credit_card_form_fields', $filtered_fields, $this->id ) includes/class-chip-woocommerce-gateway.php:4153
  4. PagBank / PagSeguro e Vindi para WooCommerce icon PagBank / PagSeguro e Vindi para WooCommerce3,000+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, Connect::DOMAIN ) src/templates/payments/creditcard.php:94
  5. Express Checkout via PayPal for WooCommerce icon Express Checkout via PayPal for WooCommerce800+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) ppcp/includes/class-ppcp-paypal-checkout-for-woocommerce-gateway.php:111
  6. XL NMI Gateway for WooCommerce icon XL NMI Gateway for WooCommerce800+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-nmi-gateway-woocommerce-base.php:594
  7. Elavon Payment Gateway for WooCommerce icon Elavon Payment Gateway for WooCommerce300+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) src/ConvergeGateway.php:1734
  8. Sola Payment Gateway for WooCommerce icon Sola Payment Gateway for WooCommerce300+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-wc-gateway-cardknox.php:199
  9. Authorize.Net/eProcessing Network Payment Gateway for WooCommerce icon Authorize.Net/eProcessing Network Payment Gateway for WooCommerce100+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) authorize.net-woocommerce-lightweight-addon.php:328
  10. e-SCOTT Smart light for WooCommerce icon e-SCOTT Smart light for WooCommerce100+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-spfwc-light-payment-gateway.php:450
  11. Kuroneko Web Collect for Woo icon Kuroneko Web Collect for Woo100+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-kupaywc-payment-gateway.php:367
  12. pay bi icon pay bi100+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) ebi_pay_classic_gateway.php:207
  13. Paymentfor Gateway for WooCommerce icon Paymentfor Gateway for WooCommerce90+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-paymentfor-wc-payment-gateway.php:488
  14. Complete PayPal Payments For WooCommerce icon Complete PayPal Payments For WooCommerce80+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-complete-paypal-payments-for-woocommerce-gateway.php:107
  15. MerchantOne Payment Gateway WooCommerce Addon icon MerchantOne Payment Gateway WooCommerce Addon70+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) webmicro-merchantone-woo-addon.php:272
  16. Network Merchant Payment Gateway for WooCommerce icon Network Merchant Payment Gateway for WooCommerce60+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) webmicro-nmi-woo-addon.php:250
  17. Avify icon Avify50+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) avify-payments-gateway.php:346
  18. Payroc Gateway for WooCommerce icon Payroc Gateway for WooCommerce40+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-payroc-gateway.php:648
  19. Worldnet Payments Gateway for WooCommerce icon Worldnet Payments Gateway for WooCommerce40+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-worldnetpayments-gateway.php:648
  20. Bluepay Payment Gateway WooCommerce Addon icon Bluepay Payment Gateway WooCommerce Addon30+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) webmicro-bluepay-woo.php:307
  21. goEmerchant Payment Gateway Plugin for WooCommerce icon goEmerchant Payment Gateway Plugin for WooCommerce30+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-wc-gateway-goe.php:956
  22. e-SCOTT Smart pro for WooCommerce icon e-SCOTT Smart pro for WooCommerce20+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-spfwc-payment-gateway.php:526
  23. PayPal Payflow Pro Payment gateway for WooCommerce icon PayPal Payflow Pro Payment gateway for WooCommerce20+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) webmicro-payflowpro-woo-addon.php:347
  24. MerchantX Gateway for WooCommerce icon MerchantX Gateway for WooCommerce10+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) class/merchantx_gateway.php:326
  25. PayPal Website Payments Pro for WooCommerce icon PayPal Website Payments Pro for WooCommerce10+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) paypalpro-woocommerce-addon.php:190
  26. Braintree Payment Gateway For WooCommerce icon Braintree Payment Gateway For WooCommerce10+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) webmicro-braintree-woo-addon.php:211
  27. Woo Braintree Payment icon Woo Braintree Payment10+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) include/woo-mynix-braintree.php:92
  28. Ecrypt Payment Gateway for WooCommerce icon Ecrypt Payment Gateway for WooCommerce10+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/classes/ecrypt-payment-gateway-method.php:501
  29. Payment Gateway for Nuvei on WooCommerce icon Payment Gateway for Nuvei on WooCommerce10+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) wc-nuvei-payment-gateway.php:259
  30. 1stPayGateway for WooCommerce icon 1stPayGateway for WooCommerce10+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/class-wc-gateway-1stpay.php:956
  31. Thanh Toan The Cao Dien Thoai icon Thanh Toan The Cao Dien Thoai10+ installs apply_filters( 'woocommerce_credit_card_form_fields', array($this, 'phonecard_payment_form') ) card-getway.php:45
  32. Neopayment icon Neopayment10+ installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) class-neopayment-cc.php:147
  33. Goopter advanced integration for PayPal Complete Payments and for WooCommerce icon Goopter advanced integration for PayPal Complete Payments and for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) ppcp-gateway/class-wc-gateway-cc-goopter.php:427
  34. CartGateway Payment Gateway for WooCommerce icon CartGateway Payment Gateway for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) includes/cart_gateway.php:326
  35. Payments Gateway for Greenlight on WooCommerce icon Payments Gateway for Greenlight on WooCommerceFewer than 10 installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) classes/class-wc-greenlight-payments.php:277
  36. Payment Gateway for Frubipay icon Payment Gateway for FrubipayFewer than 10 installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) template-parts/card-form.php:26
  37. Facture Pay icon Facture PayFewer than 10 installs apply_filters( 'woocommerce_credit_card_form_fields', $default_fields, $this->id ) facture-authorize-woocommerce.php:119

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.