Dismiss ACF Unsafe HTML Notice

The ACF plugin in version 6.2.5 and above displays a message like this: ACF now automatically escapes unsafe HTML when rendered by the_field or the ACF shortcode. If you know your field content is safe and want to dismiss this message, add the following code to your functions.php file:

function savvy_acf_remove_msg() {
	add_filter('acf/admin/prevent_escaped_html_notice', '__return_true');
	add_filter('acf/shortcode/allow_unsafe_html', '__return_true');
	add_filter('acf/the_field/allow_unsafe_html', '__return_true');
}
add_action('init', 'savvy_acf_remove_msg');
Discussion
[  0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!