Wp Rest API request posts from a custom taxonomy

I’m trying to get posts from a custom taxonomy term in a custom post type but it is just displaying all the posts in the custom post type.

I’ve tried using Filter in my endpoint url but I have a feeling this is no longer possible. This is what I’ve got.

http://www.example.net/wp-json/wp/v2/directory/?filter[directory_type]=exhibitor-directory

This is my first outing with Rest API so sorry if I’m missing something obvious.

1 Answer
1

So it turns out in WP 4.7 the Filter argument for any post endpoint was removed. You can add it but installing this plugin on the site that you are trying to get posts from.

https://github.com/WP-API/rest-filter

Leave a Comment