Home › Forums › ACF PRO › Escaping & in text fields › Reply To: Escaping & in text fields
This is my function now.
function pg_check_html_tags_text( $value, $post_id, $field ) {
if ( $value != strip_tags( $value ) ) {
$allowed_tags = array();
$value = wp_kses( $value, $allowed_tags );
}
return $value;
}
add_filter( 'acf/update_value/type=text', 'pg_check_html_tags_text', 10, 3 );
Could it be ‘fixed’ by adding $value = html_entity_decode( $value );
before if ( $value != strip_tags( $value ) ) {
?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.