Home › Forums › Front-end Issues › Is sanitization required for front end form? › Reply To: Is sanitization required for front end form?
I think it should be an option when declaring the field. For now you can add a filter like this:
add_filter('acf/update_value', function ($value, $id, $field) {
// Decide whether you want to sanitize based on $id or $field
// In my case, I just wanted to sanitize the user fields
if (strpos($id, 'user_') !== 0)
{
return $value;
}
return sanitize_text_field($value);
}, 10, 3);
Hope this helps until it has been properly fixed.
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.