I was tasked to create a service that queries the latest posts from another wordpress site and creates a copy of the post on the wordpress site we manage.

It's a relatively simple task but i can't figure out how to create a media object from the url of the image i get from the original post, so i can attach it as featured media on the post on our website.


Note: This process is completely authorized from both parties, it's a partnership between the two websites.

  • I believe what you need first is to obtain the thumbnail ID from the first post via the API, then run a second API call to get the image based on it's ID. Oct 20, 2022 at 18:18


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.