Support

Account

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.