Skip to content

Instantly share code, notes, and snippets.

@ncesar
Created January 16, 2019 01:32
Show Gist options
  • Save ncesar/b6e6e109deeb789aed9ad0eb11211f21 to your computer and use it in GitHub Desktop.
Save ncesar/b6e6e109deeb789aed9ad0eb11211f21 to your computer and use it in GitHub Desktop.
Mascarar números ou qualquer outro campo do WooCommerce com plugin específico
/**
* WordPress Plugin: Masks Form Fields v1.2 - https://wordpress.org/plugins/masks-form-fields/
* PHP - Custom script to add mask in input phone the WooCommerce. /wp-content/themes/YOUR-THEME/functions.php
*/
add_action('wp_footer', function () {echo "<script type=\"text/javascript\">jQuery(document).ready(function($){ $(\"input[name='billing_phone']\").mask('(000) 000-0000'); });</script>";}, 111);
/**
* WordPress Plugin: Masks Form Fields v1.2 - https://wordpress.org/plugins/masks-form-fields/
* JavaScript - Custom script to add mask in input phone the WooCommerce.
*/
jQuery(document).ready(function($){
 $("input[name='billing_phone']").mask("(000) 000-0000");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment