I'm trying to put a <span> tag inside of the <p> wrapper tag on checkout page for shipping city field. I have tried so much different ways, but all of them have failed.
Here is my code attempt (doesn't work):
function hackies( $field, $key, $args, $value ) {
// Wrap all fields except first and last name.
if ( $key === 'shipping_city' ) {
$field .= '<span>hello world</span>';
}
return $field;
}
add_filter( 'woocommerce_form_field_text', 'hackies', 10, 4);
But it's not working, anyone could help with this?