I'm trying to create a feature that allows my website to:
- Crawl through a CSV file and programmatically create a post
- Upload a featured image based off a URL from the CSV file to the Media Library (which is using a S3 Bucket - CDN)
Where I'm stuck is in point two, I'm not sure how to add the image to the media library and trigger the upload to the CDN, then set it as the featured image.
I'm using W3 Cache plugin to connect it to the S3 Bucket.