Skip to content

Instantly share code, notes, and snippets.

@xadapter
Created August 11, 2016 07:21
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 xadapter/177523216d8281462c2c39809d68930a to your computer and use it in GitHub Desktop.
Save xadapter/177523216d8281462c2c39809d68930a to your computer and use it in GitHub Desktop.
WooCommerce - Change a Required Checkout Field to Optional
add_filter( 'woocommerce_billing_fields', 'xa_filter_billing_phone', 10, 1 );
function xa_filter_billing_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