Support

Account

Home Forums Bug Reports add_filter(acf/update_value, wp_kses_post) in acf_form() breaks select fields Reply To: add_filter(acf/update_value, wp_kses_post) in acf_form() breaks select fields

  • ACF stores some values, like multi-select and checkbox fields as well as some others as serialized arrays. Running wp_kses_post on these values after ACF has serialized them removes the formatting needed to unserialize them. Running it on arrays before they have been serialized converts them to a strings.

    If you want to run this on these types of fields you’d need to run it on each element of the array rather than the array itself before itis serialized. You’ll probably need to create a specific filter to do it.

    If you want to run this on text, textarea and other fields that allow arbitrary input you should target these fields with the field type involved

    add_fitler('acf/update_value/type=text, ‘wp_kses_post’);`