Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Last active July 8, 2021 21:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifgriffin/38d6d953f9dfe55d3498a3056940427e to your computer and use it in GitHub Desktop.
Save clifgriffin/38d6d953f9dfe55d3498a3056940427e to your computer and use it in GitHub Desktop.
<?php
// Do NOT include the opening php tag.
// Place in your theme's functions.php file
// Make phone fields optional
add_filter('woocommerce_checkout_fields', 'unrequire_phone_fields' );
function unrequire_phone_fields( $fields ) {
$fields['billing']['billing_phone']['required'] = false;
$fields['shipping']['shipping_phone']['required'] = false;
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment