• Hi!

    I’m trying to filter posts by category using:
    /wp-json/wp/v2/posts?filter[category]=7 or /wp-json/wp/v2/posts?filter[cat]=7
    (category, seems to be the right slug for my taxonomy)
    But it wasn’t successful, all posts are returned.

    I then saw this post mentioning that filtering may not working.

    So I tried to filtering using other parameters, like this:
    /wp-json/wp/v2/posts?filter[tag__and][]=3677&filter[tag__and][]=3673
    But I’m getting all posts, seems like ?filter param is always ignored.

    Am I missing anything here?
    Thank you very much.

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

Viewing 1 replies (of 1 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    /wp-json/wp/v2/posts?filter[cat]=7 should work.

    Just to confirm, you’re running the latest release of WP-API, and you’ve disabled all plugins / are using the default theme to ensure there aren’t any code conflicts?

Viewing 1 replies (of 1 total)

The topic ‘Confusion about filters’ is closed to new replies.