Skip to content

Instantly share code, notes, and snippets.

@hendcorp
Last active Aug 23, 2017
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