Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save woogists/c32b71157e20c922ac975759b0f2e68c to your computer and use it in GitHub Desktop.
Save woogists/c32b71157e20c922ac975759b0f2e68c to your computer and use it in GitHub Desktop.
[Customizing checkout fields using actions and filters] WooCommerce custom checkout fields make phone number not required example.
add_filter( 'woocommerce_billing_fields', 'wc_npr_filter_phone', 10, 1 );
function wc_npr_filter_phone( $address_fields ) {
$address_fields['billing_phone']['required'] = false;
return $address_fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment