Add image to media library from URL in uploads directory
If the image is in the content source you can extract it and use media_sideload_image(); to import it into the media library. This code sample is from my plugin Media Tools. Which has does this via a admin page via ajax. It also sets the extracted image as the featured image for the post. The … Read more