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’);`
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5
— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.