Skip to content

Instantly share code, notes, and snippets.

@purplefeel
Created January 10, 2021 21:35
Show Gist options
  • Save purplefeel/9396daaaa2495c1af2cb1de8a2a1ead2 to your computer and use it in GitHub Desktop.
Save purplefeel/9396daaaa2495c1af2cb1de8a2a1ead2 to your computer and use it in GitHub Desktop.
<?php
add_filter('woocommerce_billing_fields','wpb_custom_billing_fields');
// remove some fields from billing form
// ref - https://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
function wpb_custom_billing_fields( $fields = array() ) {
unset($fields['billing_company']);
unset($fields['billing_address_1']);
unset($fields['billing_address_2']);
unset($fields['billing_state']);
unset($fields['billing_city']);
unset($fields['billing_phone']);
unset($fields['billing_postcode']);
unset($fields['billing_country']);
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment