Skip to content
This repository was archived by the owner on Aug 27, 2019. It is now read-only.
This repository was archived by the owner on Aug 27, 2019. It is now read-only.

Filter (More) Fields plugin - useful? #160

Description

@theprojectsomething

Put together a very basic plugin last night that allows deep filtering of returned data via query vars. Uses syntax close to the Facebook Graph API for accessing inner fields, e.g.
{api_endpoint}/posts?fields=id,acf{related_posts.limit(2){id}}

[{
  "id": 1,
  "acf": {
    "related_posts": [
      { "id": 2 },
      { "id": 3 }
    ]
  }
}]

Github repo is here: https://github.com/theprojectsomething/REST-API-Filter-More-Fields

Yet to publish on WP.org but it's currently working and is handy in combination with other API plugins like ACF To WP API. Keen to get some thoughts on the usefulness of the syntax before putting more effort in.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions