Created
August 14, 2015 23:24
-
-
Save ScottDeLuzio/0828fb6e039fcd88e69e to your computer and use it in GitHub Desktop.
WooCommerce checkout field hook and change default fields
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 Checkout Fields Hook | |
add_filter( 'woocommerce_checkout_fields' , 'custom_wc_checkout_fields' ); | |
// Change order comments placeholder and label, and set billing phone number to not required. | |
function custom_wc_checkout_fields( $fields ) { | |
$fields['order']['order_comments']['placeholder'] = 'Enter your placeholder text here.'; | |
$fields['order']['order_comments']['label'] = 'Enter your label here.'; | |
$fields['billing']['billing_phone']['required'] = false; | |
return $fields; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment