Skip to content

Instantly share code, notes, and snippets.

@BluePraise
Created May 11, 2022 23:22
Show Gist options
  • Save BluePraise/5ffe2ee5c1e92c535d43cd0a48acd4d8 to your computer and use it in GitHub Desktop.
Save BluePraise/5ffe2ee5c1e92c535d43cd0a48acd4d8 to your computer and use it in GitHub Desktop.
Change WooCommerce Checkout Field Optional Text
// 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