Hi ACF users,
i am all new to acf and am challenged by using ACF to upload an image via its native URL.
The situation i am stuck in is…
I have to imprt various data via xml to generate my post contents. As a part of this, the xml includes image urls which has to be used for uploading the images to my wordpress media library.
I tried nearly everything to make this happen but i dont find the right way to configure a custom field this is able to be filled with an image URL to save the image into my library.
Maybe it is not possible at all, maybe i am doing things invredibly wrong, i dont know.
Is there anybody out there who knows how i can tell wordpress that the image, included as URL in an custom field, has to be uploaded?
I would use WP All Import Pro with the ACF Add On https://www.wpallimport.com/
If I needed to do this without that plugin.
1) Create an image field
2) Use media_sideload_image() to create add the image https://developer.wordpress.org/reference/functions/media_sideload_image/. This returns an attachment ID.
3) update the ACF field with the attachment ID value https://www.advancedcustomfields.com/resources/update_field/