Skip to content

Instantly share code, notes, and snippets.

@dr5hn
Last active October 15, 2017 09:42
Show Gist options
  • Save dr5hn/2d499965377aeea85af27b4052f9ff69 to your computer and use it in GitHub Desktop.
Save dr5hn/2d499965377aeea85af27b4052f9ff69 to your computer and use it in GitHub Desktop.
WooCommerce - Change Checkout Field Label and Place Holder Text
<?php
/*
* WooCommerce - Change Checkout Field Label and Place Holder Text -- By Darshan Gada
* For more options: https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
*/
// WooCommerce Checkout Fields Hook
add_filter( 'woocommerce_checkout_fields' , 'webgeeks_wc_checkout_fields' );
// This example changes the default placeholder text for the state drop downs to "Select A State"
function webgeeks_wc_checkout_fields( $fields ) {
$fields['billing']['billing_state']['label'] = 'State';
$fields['shipping']['shipping_state']['label'] = 'State';
return $fields;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment