Created
May 11, 2022 23:22
-
-
Save BluePraise/5ffe2ee5c1e92c535d43cd0a48acd4d8 to your computer and use it in GitHub Desktop.
Change WooCommerce Checkout Field Optional Text
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
// 2021 March | |
//Change "Telephone (Optional)" Text | |
function change_checkout_optional_text( $fields ) { | |
if( is_checkout() ) { | |
$fields['billing']['billing_phone']['required'] = 'hidden'; | |
$fields['billing']['billing_phone']['label'] = 'Telephone (We will only use this for delivery)'; | |
} | |
return $fields; | |
} | |
add_filter( 'woocommerce_checkout_fields' , 'change_checkout_optional_text', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment