Last active
December 20, 2023 09:48
-
-
Save cryptexvinci/acfffd317ea6593d85f87191f92528c6 to your computer and use it in GitHub Desktop.
Rename WooCommerce checkout field label & placeholder
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
<?php | |
// WooCommerce Rename Checkout Fields | |
add_filter( 'woocommerce_checkout_fields' , 'custom_rename_wc_checkout_fields' ); | |
// Change placeholder and label text | |
function custom_rename_wc_checkout_fields( $fields ) { | |
$fields['billing']['billing_first_name']['placeholder'] = 'Wonka'; | |
$fields['billing']['billing_first_name']['label'] = 'Your Awesome First Name'; | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works with WooCommerce 8.4.0
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
$fields['billing']['billing_postcode']['label'] = 'Postal Code ';
return $fields;
}