Home › Forums › Feedback › Auto Prefill Fields based on EXIF › Reply To: Auto Prefill Fields based on EXIF
I’m not sure if this is going to be any help to you or not because I don’t know exactly how to accomplish what you want to do.
If you want to see your additional fields refreshed when an image is uploaded and chosen, you’ll need to do some of your own AJAX to get it done. I know that image uploads are handled by WP and not by ACF. After the upload an event is triggered that causes ACF to get the data related to the image and populate the image field.
Your best bet is to add an event action when this happens, do your own AJAX request to get the additional information that you are looking for and then populate the additional fields. This is where my knowledge is lacking, but I can give you some examples of triggering AJAX requests when ACF fields change and populating other fields based on the results of the requests. There just isn’t anything specifically related to doing this for an image field so you’ll need to do some investigation to get it done and it will likely take a bit of trial and error. Anyway, you can find my examples of dynamically loading ACF fields using AJAX here https://github.com/Hube2/acf-dynamic-ajax-select-example
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!
🗓️ Just one more day until the next session of ACF Chat Fridays! Make sure to register for the latest updates on what’s coming in ACF 6.1!— Advanced Custom Fields (@wp_acf) March 30, 2023
📆 Friday 31st March 3pm UTC
👉 Register here - https://t.co/3UtvQbDwNm pic.twitter.com/7xtEJakeQN
© 2023 Advanced Custom Fields.