Skip to content

Instantly share code, notes, and snippets.

@hendcorp
Last active August 23, 2017 17:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
WooCommerce : Disable Autofocus on the First Name field under Billing and Shipping address.
<?php
/* Disable autofocus on the billing First Name field */
add_filter('woocommerce_billing_fields','disable_autofocus_billing_firstname');
function disable_autofocus_billing_firstname($fields) {
$fields['billing_first_name']['autofocus'] = false;
return $fields;
}
/* Disable autofocus on the shipping First Name field */
add_filter('woocommerce_shipping_fields','disable_autofocus_shipping_firstname');
function disable_autofocus_shipping_firstname($fields) {
$fields['shipping_first_name']['autofocus'] = false;
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment