wp-api-v2-client-java icon indicating copy to clipboard operation
wp-api-v2-client-java copied to clipboard

Searching for posts by status draft

Open paratechnical opened this issue 6 years ago • 0 comments

Hi,

I tried searching for posts. I need to find those having a post with a certain title with the "draft" status.

SearchRequest<Post> sr = 
            SearchRequest.Builder.aSearchRequest(Post.class)
            .withUri(Request.POSTS)
            .withFilter("title",episode.getTitle())
            .withFilter("status","draft")
            .build();
    PagedResponse<Post> postsAlreadyThere = client.search(sr);`

This returns all posts with "published" status. I also tried with post_status and post_title for filter as well, but no change. I tried installing a JSON filter plugin in my wordpress https://github.com/WP-API/rest-filter , but unfortunatelly nothing seems to work

Am I doing somethingwrong or is this a bug?

paratechnical avatar May 29 '18 07:05 paratechnical