Remove billing_email from WooCommerce addon

This function remove billing_email from WooCommerce addon.

wppb_woo_billing_fields is located in PB WooCommerce Add-on: billing-fields.php

1
2
3
4
5
6
7
8
9
10
11
/*
 * Remove billing_email from WooCommerce addon
 */
 
add_filter( 'wppb_woo_billing_fields', 'wppbc_remove_billing_email' );
function wppbc_remove_billing_email( $fields ) {
   if( is_array( $fields ) && isset( $fields['billing_email'] ) ) {
      unset( $fields['billing_email'] );
   }
   return $fields;
}