Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Created January 27, 2021 16:23
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/160d0c74f699c5e5186b6d69bbe88148 to your computer and use it in GitHub Desktop.
Save clifgriffin/160d0c74f699c5e5186b6d69bbe88148 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'woocommerce_default_address_fields', function( $fields ) {
$fields['address_1']['custom_attributes']['data-parsley-pattern'] = '.*[0-9].*';
$fields['address_1']['custom_attributes']['data-parsley-error-message'] = 'Please enter your house number.';
return $fields;
}, 100001 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment