Created
January 25, 2022 21:06
-
-
Save slavapas/413e669282aee174efe7e82924709a2a to your computer and use it in GitHub Desktop.
Woocommerce unify Name and Surname in one line
This file contains 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
add_filter( 'woocommerce_billing_fields' , 'ced_remove_billing_fields' ); | |
function ced_remove_billing_fields( $fields ) { | |
unset($fields['billing_last_name']); | |
return $fields; | |
} | |
add_filter( 'woocommerce_checkout_fields' , 'ced_rename_checkout_fields' ); | |
// Change placeholder and label text | |
function ced_rename_checkout_fields( $fields ) { | |
$fields['billing']['billing_first_name']['placeholder'] = 'Name'; | |
$fields['billing']['billing_first_name']['label'] = 'Name'; | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment