Home › Forums › Front-end Issues › Image not attached to post on save acf form › Reply To: Image not attached to post on save acf form
I tried:
update_post_meta($post_id, ‘_thumbnail_id’, $image_id);
It sets my image as featured image, and it displays correctly, but the image is still unattached to the post, therefor not in the media uploaded to post list.
I found this function, wp_media_attach_action(). Not sure how to use it 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.