Last active
October 15, 2017 09:42
-
-
Save dr5hn/2d499965377aeea85af27b4052f9ff69 to your computer and use it in GitHub Desktop.
WooCommerce - Change Checkout Field Label and Place Holder Text
This file contains hidden or 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 - 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