Save a file from web into Media Library in WordPress

http://theme.fm/2011/10/how-to-upload-media-via-url-programmatically-in-wordpress-2657/

You could use download_url to grab a file from a given URL, then use media_sideload_image to save it into Media Library and attach to a post (optional).

I’m a senior web developer helping clients build their websites to grow businesses. Currently I’m based in Taipei, Taiwan.

I write things about WordPress, AngularJS and life. Whenever you’d like to find someone to talk about these topics, just get in touch!

Submit a comment

Your email address will not be published. Required fields are marked *