Skip to content

Instantly share code, notes, and snippets.

@cryptexvinci
Last active December 20, 2023 09:48
Show Gist options
  • Save cryptexvinci/acfffd317ea6593d85f87191f92528c6 to your computer and use it in GitHub Desktop.
Save cryptexvinci/acfffd317ea6593d85f87191f92528c6 to your computer and use it in GitHub Desktop.
Rename WooCommerce checkout field label & placeholder
<?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;
}
@wellyington
Copy link

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;
}

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