Skip to content

Searching for posts by status draft #49

Description

@paratechnical

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions