Home › Forums › ACF PRO › Submitted images not retrieved in acf_form › Reply To: Submitted images not retrieved in acf_form
Hi @beee
I’ve just checked your site and it seems the front end form doesn’t load the proper data. Could you please try to set one of the custom post type ID to the form’s post_id
option like the following?
acf_form(array(
'post_id' => '99',
'submit_value' => $submit_button,
'updated_message' => $updated_message
));
Where ’99’ is the custom post ID. If it shows the correct data, then there’s something wrong with how you get the post ID.
WordPress shortcode needs you to return the string you want to show on the front end. But because acf_form()
doesn’t return anything (it just prints the form immediately), you can’t return it. This is where output buffering is used. Instead of printing the form right away, by using ob_start()
and ob_get_contents()
you can put the string (the form) in a variable first and then later return it from the shortcode. If you don’t know how this works, kindly visit PHP community.
Also, could you please upload the files that have long content instead of copying it to your reply? Because copying it makes the thread hard to read.
Thanks 🙂
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.