Skip to content

Instantly share code, notes, and snippets.

@slavapas
Created January 25, 2022 21:06
Show Gist options
  • Save slavapas/413e669282aee174efe7e82924709a2a to your computer and use it in GitHub Desktop.
Save slavapas/413e669282aee174efe7e82924709a2a to your computer and use it in GitHub Desktop.
Woocommerce unify Name and Surname in one line
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