All around the Interwebs I see advice from people who say that when you want to get posts in a custom taxonomy you should use the filter parameter, for example:
https://example.com/wp-json/wp/v2/posts?filter[genre]=fiction
This seems like a very handy parameter. But in v2 of the WP REST API it just doesn’t work. When I created a WP Trac ticket to find out what was going on, @swissspidy responded that “the filter param has been removed on purpose” but that the documentation hasn’t been updated yet. The change is discussed in Trac ticket 38378.
OK, fair enough, but could someone tell me how I should retrieve posts in a custom taxonomy now? I’m writing a plugin that depends on being able to do this.
For example, if I’ve created a non-hierarchical custom taxonomy instance
and given it the value 1
for certain posts in a custom post type, how can I retrieve all the posts of that type and with instance=1
?
If it’s not possible via the REST API, is there a way to do it via the WordPress.com API on a Jetpack-enabled self-hosted site?