Home › Forums › General Issues › acf_form Validation in Block › Reply To: acf_form Validation in Block
Thanks, John. Sadly this solution didn’t work for me. My best guess is it’s because wp_doing_ajax()
returns true both on the front end-submit and in the block editor.
I’ve got around it though by using ACF JS and just returning return { valid: 1 };
JSON response for all forms and just loading that script in WP Admin.
acf.add_filter('validation_complete', function( json, $form ){
// return
return { valid: 1 };
});
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.