WordPress.org

Ready to get started?Download WordPress

Forums

JSON REST API (WP API)
[resolved] Get multiple posts/media by ID (3 posts)

  1. eigilsagafos
    Member
    Posted 2 months ago #

    Hey,

    I'm wondering how I can get multiple media items at a time by their ID? I'm able to get one at a time, and have tried to figure out if there is a way to do it with filters, but no luck so far. When trying to fetch all the images for a post I now have to get them one by one by their ID.

    Any ideas?

    https://wordpress.org/plugins/json-rest-api/

  2. Ryan McCue
    Member
    Plugin Author

    Posted 2 months ago #

    You should be able to do it with the post__in filter:

    GET /posts?filter[post__in][]=1&filter[post__in][]=2&filter[post__in][]=3

    We've got a documentation ticket open for this too. :)

  3. eigilsagafos
    Member
    Posted 2 months ago #

    Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic