How to retrieve image from URL and set as featured image/post thumbnail
My favorite way of handling this problem has been to use a little documented function I discovered on another stack post: media_sideload_image It works by fetching an image url to the WordPress upload dir and then associating the image to a post’s attachments. You can try it like so: // required libraries for media_sideload_image require_once(ABSPATH … Read more