Skip to content

Instantly share code, notes, and snippets.

@luiseduardobraschi
Last active December 8, 2020 19:06
Show Gist options
  • Save luiseduardobraschi/94a9e0574184b4f7cb33da2107e14f06 to your computer and use it in GitHub Desktop.
Save luiseduardobraschi/94a9e0574184b4f7cb33da2107e14f06 to your computer and use it in GitHub Desktop.
Remover o campo "sexo" do checkout do WooCommerce com Extra Checkout Fields for Brazil.
<?php
add_filter( 'woocommerce_billing_fields', function( $fields ){
unset( $fields['billing_sex'] );
return $fields;
});
@feperrella
Copy link

Hi, it's not working anymore...

@luiseduardobraschi
Copy link
Author

Hi, it's not working anymore...

Hi, @feperrella. Try changing the priority.

add_filter( 'woocommerce_billing_fields',  function( $fields ){
	unset( $fields['billing_sex'] );
	return $fields;
}, 100 ); // <----------

@feperrella
Copy link

Hi, it's not working anymore...

Hi, @feperrella. Try changing the priority.

add_filter( 'woocommerce_billing_fields',  function( $fields ){
	unset( $fields['billing_sex'] );
	return $fields;
}, 100 ); // <----------

Thanks, that did the trick, never thought about that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment