Home › Forums › Front-end Issues › acf_form() validation and feedback › Reply To: acf_form() validation and feedback
Yeah, ‘ I’ve ma ed a mistake with that example code. It should be
'post_type' => 'post',
post_status' => 'publish'
I think I solved my problem with using:
wp_redirect(add_query_arg( 'error', 'true', get_permalink($submit_page_id)));
in the _action_ssd_acf_submit_post_pre_save
function in the following hook:
add_action( 'acf/pre_save_post', '_action_ssd_acf_submit_post_pre_save', 1 );
This way I don’t use the return
of the acf_form()
function and redirect to the same page with the form but the parameters in the URL which I can get to show the error notice on that page.
Don’t know if this is the right way though.
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.