Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Last active February 8, 2020 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifgriffin/5503ea4374c190288e71058d61b45fdf to your computer and use it in GitHub Desktop.
Save clifgriffin/5503ea4374c190288e71058d61b45fdf to your computer and use it in GitHub Desktop.
Change validation trigger for billing email field with Checkout for WooCommerce.
<?php
// Include in your theme's functions.php file or with your favorite snippets plugin
// Do NOT include the opening PHP tag above (<?php)
add_filter(
'woocommerce_checkout_fields', function( $fields ) {
// Change billing email validation trigger to focusout
$fields['billing']['billing_email']['custom_attributes']['data-parsley-trigger'] = 'focusout';
return $fields;
}, 2000
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment