Support

Account

Home Forums Backend Issues (wp-admin) wp_kses breaks select images

Solving

wp_kses breaks select images

  • ACF 5.10.0 added wp_kses which is stopping images from loading inside select fields. I used to be able to use the “Stylized UI” Select field with values like this:

    
    announcement : <img src="https://web.com/announcement.img">
    arrow : <img src="https://web.com/arrow.img">
    

    But it echos out &lt instead of < and &gt instead of > around the image tag, which keeps it from rendering.

    I’ve tried updating the wp_kses_allowed_html filter but nothing seems to make a difference.

  • Hey, thanks for the report!

    We’re intended to release a patch next week that will allow safe HTML like this inside a select2 field.

  • Hey there!

    I’m seeing the same problem – is there any solution for that?
    I do have a select field with the stylized UI set to true and the following choices

    
    jacquarda : <span class="ff--jac">Jacquarda</span>
    clay : <span class="ff--cla">Clay</span>
    

    The wp_kses_allowed_html filter shows that the span tag is allowed for the acf context.

    Thanks a lot!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.