Skip to content

Instantly share code, notes, and snippets.

@jondcampbell
Created April 29, 2015 22:19
Show Gist options
  • Save jondcampbell/756d6baf0ab3e1b3639c to your computer and use it in GitHub Desktop.
Save jondcampbell/756d6baf0ab3e1b3639c to your computer and use it in GitHub Desktop.
disable the billing fields at woocommerce checkout. sadly it doesnt add to your custom attributes, it just replaces them with disabled.
function custom_disable_woocommerce_billing_checkout_fields( $fields ) {
foreach ($fields['billing'] as $key => $billing_field){
$fields['billing'][$key]['custom_attributes'] = array('disabled' => 'disabled') ;
}
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'custom_disable_woocommerce_billing_checkout_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment