WordPress filter hook

woocommerce_admin_billing_fields

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

“Provides an opportunity to modify the list of order billing fields displayed on the admin.”

How to use woocommerce_admin_billing_fields

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

functions.php
add_filter( 'woocommerce_admin_billing_fields', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Argument names come from GLS Click&Ship (Denmark)'s source. Other plugins may pass different values: check the call in the plugin you're targeting below.

7 plugins that fire woocommerce_admin_billing_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_admin_billing_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address line 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'A... ) includes/admin/meta-boxes/class-wc-meta-box-order-data.php:55
  2. WCFM icon WCFM10,000+ installs apply_filters( 'woocommerce_admin_billing_fields', array( 'first_name' => array( 'label' => __( 'First Name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last Name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'Addres... ) core/class-wcfm-library.php:1704
  3. bpost-shipping-platform icon bpost-shipping-platform500+ installs apply_filters( 'woocommerce_admin_billing_fields', array( 'first_name' => array( 'label' => esc_html__('First name', 'bpost-shipping-platform'), 'show' => false, ), 'last_name' => array( 'label' => esc_html__('Last name', 'bpost-shipping-platform'), 'show' => false, ), 'company' => array( 'label' => esc_html__('Company', 'bpost-shipping-platform'), 'show' => false, ), 'address_1' => array( 'label' => esc_html__('Address line 1', 'bpost-shipping... ) includes/class-woo-Bpost-order.php:1261
  4. WooCommerce PayPal Here Payment Gateway icon WooCommerce PayPal Here Payment Gateway100+ installs apply_filters( 'woocommerce_admin_billing_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce-gateway-paypal-here' ), 'show' => false, 'show_above' => true, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce-gateway-paypal-here' ), 'show' => false, 'show_above' => true, ), 'email' => array( 'label' => __( 'Email address', 'woocommerce-gateway-paypal-here' ), 'show_above' => true, ), 'phone' => array( ... ) includes/Admin/Meta_Boxes/Order_Data.php:405
  5. Shiptimize for WooCommerce icon Shiptimize for WooCommerce100+ installs apply_filters( 'woocommerce_admin_billing_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address line 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'A... ) includes/class-woo-shiptimize-order.php:1222
  6. GLS Click&Ship (Denmark) icon GLS Click&Ship (Denmark)100+ installs apply_filters( 'woocommerce_admin_billing_fields', array( 'first_name' => array( 'label' => $GLSDk->translate( 'First name' ), 'show' => false, ), 'last_name' => array( 'label' => $GLSDk->translate( 'Last name' ), 'show' => false, ), 'company' => array( 'label' => $GLSDk->translate( 'Company' ), 'show' => false, ), 'address_1' => array( 'label' => $GLSDk->translate( 'Address line 1' ), 'show' => false, ), 'address_2' => array( 'label' => $GLSDk... ) includes/class-woo-GLSDk-order.php:1228
  7. Invoice management for Woocommerce icon Invoice management for WoocommerceFewer than 10 installs apply_filters( 'woocommerce_admin_billing_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address line 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'A... ) admin/meta-boxes/class-wc-meta-box-order-data.php:41

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.