Skip to content

Instantly share code, notes, and snippets.

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 vyskoczilova/a524aba303f378bc865c9feea8265add to your computer and use it in GitHub Desktop.
Save vyskoczilova/a524aba303f378bc865c9feea8265add to your computer and use it in GitHub Desktop.
WooCommerce check Billing phone against pattern
add_filter( 'woocommerce_checkout_fields' , 'wc_kbnt_override_checkout_fields' );
function wc_kbnt_override_checkout_fields( $fields )
{
$fields['billing']['billing_phone']['custom_attributes'] = array( "pattern" => "^\+?{1}[0-9 ]{9,17}$" );
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment