Skip to content

Instantly share code, notes, and snippets.

@rayneboes1
Forked from BFTrick/functions.php
Created October 7, 2021 03:14
Show Gist options
  • Save rayneboes1/c65d6277f5e4b1fa675b1781d732c722 to your computer and use it in GitHub Desktop.
Save rayneboes1/c65d6277f5e4b1fa675b1781d732c722 to your computer and use it in GitHub Desktop.
Remove the Phone Number field in the WooCommerce checkout
<?php
// Filter the checkout fields
add_filter( 'woocommerce_checkout_fields', 'patricks_woocommerce_checkout_fields' );
// Remove the billing phone - $fields is passed via the filter
function patricks_woocommerce_checkout_fields( $fields ) {
// remove the phone field
unset($fields['billing']['billing_phone']);
// make the billing email field fill up the entire space
$fields['billing']['billing_email']['class'] = array('form-row-wide');
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment