bobbingwide / vgc

VGC - Garden Vista Group theme
GNU General Public License v2.0
0 stars 0 forks source link

Update to cater for security improvements in ACF / ACF Pro #78

Open bobbingwide opened 3 months ago

bobbingwide commented 3 months ago

Since ACF v6.2.7 ACF PRO now produces a message in the dashboard.

ACF PRO — ACF now automatically escapes unsafe HTML when rendered by the_field or the ACF shortcode. We've detected the output of some of your fields has been modified by this change, but this may not be a breaking change. Learn more. Show details.

bobbingwide commented 3 months ago

The simplest solution to the problem of ACF producing messages about unsafe HTML is to tell ACF that we don't care. This can be done with one line of code in the theme.

/**
 * Tell ACF that we're happy to include HTML in fields.
 */
add_filter( 'acf/the_field/allow_unsafe_html', '__return_true' );

this filter will return true regardless of the field that's being processed. The filter is invoked for both the_field() and the_sub_field().