Created
November 10, 2020 14:09
-
-
Save brandonkramer/08b5f3563a331173dea52274a071176b to your computer and use it in GitHub Desktop.
Add description, (footnote) text or html under a checkout field in WooCommerce
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
// Text field | |
add_filter('woocommerce_form_field_text', function ($field, $key, $args, $value) { | |
if ($key === 'billing_first_name') { | |
$field .= 'here text <a href="/">with link</a>'; | |
} | |
return $field; | |
}, 10, 4); | |
// Phone field | |
add_filter('woocommerce_form_field_tel', function ($field, $key, $args, $value) { | |
if ($key === 'billing_phone') { | |
$field .= 'here text <a href="/">with link</a>'; | |
} | |
return $field; | |
}, 10, 4); | |
// E-mail field | |
add_filter('woocommerce_form_field_email', function ($field, $key, $args, $value) { | |
if ($key === 'billing_email') { | |
$field .= 'here text <a href="/">with link</a>'; | |
} | |
return $field; | |
}, 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment