Home › Forums › General Issues › Automatically fill image field with post_thumbnail › Reply To: Automatically fill image field with post_thumbnail
Oh, I may have come across the problem itself.
add_action('save_post', 'add_image_to_acf_field');
is supposed to trigger when a post is published, right, not when a post is saved regardless of the saving type?
The front-end submissions only get saved as drafts, and once I publish it afterwards (i.e. open in backend and publish it), the field gets filled properly. So the draft state might be the problem?
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.