Home › Forums › Bug Reports › Problem with update_field for a user image field › Reply To: Problem with update_field for a user image field
I am actually uploading an image from an url like this
$create_image = new JDN_Create_Media_File( $image_url );
$image_id = $create_image->attachment_id;
JDN_Create_Media_File is from here.
https://joshuadnelson.com/programmatically-add-images-to-media-library/
I am now updating the image of the user with the acf/save_post with the name of the field and it works.
I tried using it with acf/pre_save_post it did not work. Maybe it is because the image is not uploaded quickly enough? The strange thing is that using the update_field function with an image field inside a post worked (with name and with key field). I also tried updating a field for a user and it also worked (with name and with key field), it gave me the correct image ID.
Thanks for you help.
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.