Skip to content

Instantly share code, notes, and snippets.

@ruucm
Created November 2, 2018 16:57
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 ruucm/fc8dae787fba410b0c88fed7d2265efb to your computer and use it in GitHub Desktop.
Save ruucm/fc8dae787fba410b0c88fed7d2265efb to your computer and use it in GitHub Desktop.
WordPress functions.php Cheat Sheet
/**
* Unset Woocommerce Shipping Address fields
*/
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
// remove billing fields
// unset($fields['billing']['billing_country']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_last_name']);
$fields['billing']['billing_address_1']['label'] = '주소';
// unset($fields['billing']['billing_first_name']);
// unset($fields['billing']['billing_address_1']);
// unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_city']);
// unset($fields['billing']['billing_postcode']);
// unset($fields['billing']['billing_state']);
// unset($fields['billing']['billing_phone']);
// unset($fields['billing']['billing_email']);
// remove order comment fields
unset($fields['order']['order_comments']);
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment