Skip to content

Instantly share code, notes, and snippets.

@luizbills
Created April 7, 2018 04:46
Show Gist options
  • Select an option

  • Save luizbills/3068bec6a413b9425a70110ac2ca558f to your computer and use it in GitHub Desktop.

Select an option

Save luizbills/3068bec6a413b9425a70110ac2ca558f to your computer and use it in GitHub Desktop.
custom checkout fields
<?php
add_filter( 'woocommerce_checkout_fields' , 'lpb_override_checkout_fields', 20 );
function lpb_override_checkout_fields ( $fields ) {
// remove o campo "sexo"
unset( $fields['billing']['billing_sex'] );
// remove obrigatoriedade do campo "data de nascimento"
if ( isset( $fields['billing']['billing_birthdate'] ) ) {
$fields['billing']['billing_birthdate']['required'] = false;
}
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment