Created
October 25, 2024 20:24
-
-
Save igorbenic/e1840d4219913e4cd399980441e85cea to your computer and use it in GitHub Desktop.
WooCommerce Checkout Fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* NOTE: THIS IS NOT TESTED IN PRODUCTION. | |
*/ | |
add_filter( 'woocommerce_checkout_fields', 'remove_billing_shipping_wc_fields' ); | |
function remove_billing_shipping_wc_fields( $fields ) { | |
$billing_email = $fields['billing']['billing_email']; | |
$fields['billing'] = array(); | |
$fields['shipping'] = array(); | |
// Adding back email if needed | |
$fields['billing']['billing_email'] = $billing_email; | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment