Created
January 16, 2019 01:32
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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