ACF Fields not shoing correctly

I’m trying to fetch an iFrame through dynamic data from ACF. When I use a text, textarea or WYSIWYG element, Bricks renders the iFrame inside a <p> element, which causes it to be wrapped inside a box.

How do I render the dynamic code on it’s own, without being wrapped inside anything? The render without wrapper setting doesn’t help.

If I enter the iframe code directly inside Bricks, it renders fine, but if I use it inside a custom field, it wraps it inside a <p> element.

I know that’s probably because I’m using a text box for the field in ACF, but that’s the only field I can think of that would allow me to enter code, and it doesn’t sanitize the field either.

I have narrowed down the issue. The iframe comes with it’s own styling and a javascript loaded from the service that hosts the form. The returned code however doesn’t contain any of the styling and the javascript is also removed from the output.

Custom field data:

Returned HTML without the inline styles:

As a workaround, I’ve added site-wide CSS that resizes all iframes to 100% of the parent container and I loaded the Javascript file elsewhere on the page.

@timmse I am curious however why the inline styles are removed from the output and if this is something Bricks is doing?

Hi Ben,
I’m not quite sure how to replicate the issue.

Which Bricks element are you using, and what is the ACF field type that contains the iframe code?

If output the ACF field in a code element using get_field(), how does the output look like? Is it the same as you added it to the ACF field, or is something missing?

If so, it might be related to this ACF security enhancement: ACF | HTML Escaping

Best,
timmse