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.
Thanks for that link!
I followed a solution from Elliot and it worked. Here is the email from him:
It may be possible that the fontIcon JS is triggering a ‘change’ on the input. I don’t understand why, but that would explain why the prompt is showing up.
An easy fix is to reset the ACF unload js with the following line:
acf.unload.off();
You could run this after initialization, and it will rest the alert ‘changed’ variable
Oh, that’s good to know. Waiting patiently for next version.
Yes, that was it!
Cleared the transients and now it works.
Oh, I changed
$dir = get_stylesheet_directory() . '/acf/';
to
$dir = get_stylesheet_directory_uri() . '/acf/';
and it works. I’m stupid..