So would I just have to publish the plugin to add this code to my functions.php of my theme? :
*/
add_action(‘wp_footer’, function () {echo “<script type=\”text/javascript\”>jQuery(document).ready(function($){ $(\”input[name=’billing_phone’]\”).mask(‘(000) 000-0000’); });</script>”;}, 111);
Instead of billing_phone would it be billing_cep or billing_cpf?
Hi @markk26
Yes, try this.
add_action('wp_footer', function () {
echo "<script type=\"text/javascript\">
jQuery(document).ready(function($) {
$(\"input[name='billing_cpf']\").mask('000.000.000-00');
$(\"input[name='billing_postcode'], input[name='shipping_postcode']\").mask('00000-000');
});
</script>";
}, 111);
or
add_action('wp_footer', function () {
echo "<script type=\"text/javascript\">
jQuery(document).ready(function($) {
$(\"input[name='billing_cpf']\").addClass('cpf');
$(\"input[name='billing_postcode'], input[name='shipping_postcode']\").addClass('cep');
});
</script>";
}, 111);
-
This reply was modified 4 years, 2 months ago by
Petermann.
-
This reply was modified 4 years, 2 months ago by
Petermann.