I am currently working on a WordPress plugin that creates dummy content. I’d like to also have the plugin create random images using a service like http://lorempixel.com. The problem however is that when accessing the service that an actual file name isn’t generated. You generate a random image like this:

http://lorempixel.com/1200/700/

How can I use the media_handle_sideload() function to accomplish this?

2 Answers
2

Short answer, you don’t. Functions like sideload are for importing images into WordPress itself and using all the normal media library stuff. For images on an external service, use normal img tags.

If you want to copy an image from a URL, you sideload it. Not otherwise.

Tags:

Leave a Reply

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