Home › Forums › Backend Issues (wp-admin) › Custom Image Upload save to ACF Image Field in ACF Frontend Form › Reply To: Custom Image Upload save to ACF Image Field in ACF Frontend Form
I don’t know how you can do this.
An ACF image field only stores the image ID and there isn’t any way to have ACF store additional data for the image.
Possible solution:
1) Store the generated value in a hidden field
2) Create an acf/save_post filter that gets the hidden value and makes any needed changes to the attachment post for the image or its meta values that you’ll need for displaying this image. Maybe you need to somehow insert the image into the media library and alter the image ID stored by ACF. I am not familiar with how you can do this with the data that will be provided. You might potentially start here https://rudrastyh.com/wordpress/how-to-add-images-to-media-library-from-uploaded-files-programmatically.html
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.