I designed a theme for a client that sideloads an image returned from an API. It has always worked and it's still working on their live website.
My staging environment used to be a separate account on the same server. It was accessible online but password-protected and sideloading images always worked there as well. Today I created a local staging environment using VirtualHostX. Everything on the website works as expected, but sideloading doesn't.
- Nothing in my source has changed.
- The WordPress installation is a direct clone (configuration and build numbers are identical)
- I've verified that my AJAX response is returning an image URL, but the image doesn't even make it into the media library.
Before I spend too much time diagnosing this I thought I'd ask the obvious: is there a reason media_sideload_image()
wouldn't work locally?