I'm using ACF 5.9.1 and I'm trying to get a simply field text value with this string stored:
Mydomain.com - Support [email protected]
When I print the echo of
<?php echo get_field('my_text_field', 'options'); ?>
this is what I see:
Mydomain.com - Support
and obviously that is what I see on HTML source:
Mydomain.com - Support [email protected]
So every string between <> is treated such as an html node.
Is this a normal behaviour?
I fixed the issue by myself, I just escaped the string using the function esc_attr.
So to avoid "get_field" function treat <> (with any string inside) as HTML node, you only need to use this way:
And it will be printed properly as plain text.