mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://stackoverflow.com/questions/77474479/how-to-remove-asterisk-from-woocommerce-checkout-billing-email-field
9 lines
466 B
Text
9 lines
466 B
Text
add_filter( 'woocommerce_form_field' , 'remove_checkout_required_asterisk_field', 10, 4 );
|
|
function remove_checkout_required_asterisk_field( $field, $key, $args, $value ) {
|
|
// Only on checkout page and billing email field
|
|
if( is_checkout() && ! is_wc_endpoint_url() && $key === 'billing_email' ) {
|
|
$required = ' <abbr class="required" title="required">*</abbr>';
|
|
$field = str_replace( $required, '', $field );
|
|
}
|
|
return $field;
|
|
}
|