Home › Forums › Add-ons › Gallery Field › meta_input wp_insert_post acf gallery › Reply To: meta_input wp_insert_post acf gallery
if the image has a URL then you can use https://developer.wordpress.org/reference/functions/media_sideload_image/
If this is not the case then you would need to get the image file from $_FILES in PHP and manually add them to the image folder. 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.