Skip to content

Instantly share code, notes, and snippets.

@luizbills
Created June 2, 2017 01:48
Show Gist options
  • Save luizbills/e21708cbe92c010b1834e01a5a7723d6 to your computer and use it in GitHub Desktop.
Save luizbills/e21708cbe92c010b1834e01a5a7723d6 to your computer and use it in GitHub Desktop.
Fazer o campo de número do endereço aceitar apenas números
<?php
add_filter( 'woocommerce_checkout_fields' , 'lpb_change_address_number_field_input_type', 999 );
function lpb_change_address_number_field_input_type ( $fields ) {
$fields['billing']['billing_number']['type'] = 'number';
$fields['shipping']['shipping_number']['type'] = 'number';
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment