After updating to ver. 6.2.7 I now see a nag at the top of every page that ACF “now automatically escapes unsafe HTML when rendered by the_field or the ACF shortcode”.
I appreciate the notice and have verified that it will not break my site, but I want to remove the nag (I don’t want my users to have to keep clicking the small x to close the nag only for it to come back on every page refresh/content Update/new admin page).
Can you please consider adding a “got it, dismiss this forever” option? And tell me how to remove it in the meantime?
Thank you!
In case anyone else needs a solution to this specific issue, here is what worked to hide the nag.
I added this small snippet of code to my Child Theme’s functions.php file:
add_filter( 'acf/admin/prevent_escaped_html_notice', '__return_true' );
If you use this, please be sure to FIRST check your usage of (ACF’s) the_field, which now escapes any HTML in the contents of the_field, and ensure that you won’t have any site-breaking issues.
If you close the notification it should not re-appear unless it continues to find differences between the escaped and unescaped output.