Last active
July 8, 2021 21:58
-
-
Save clifgriffin/38d6d953f9dfe55d3498a3056940427e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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