JSON REST API: Version 0.2

It’s that time of week again folks (and actually on-time this time)! Version 0.2 of the JSON REST API includes my changes from the past week, including:

  • Allow all public query vars to be passed to WP Query – Some private query vars
    can also be passed in, and all can if the user has edit_posts
    permissions (#311)
  • Pagination can now be handled by using the page argument without messing
    with WP Query syntax (#266)
  • The index now generates links for non-variable routes (#268)
  • Editing a post now supports the If-Unmodified-Since header. Pass this in to
    avoid conflicting edits (#294)
  • Post types and post statuses now have endpoints to access their data (#268)

You can also view all changes if that’s your style.

As you can see, it’s a bit of a quiet week in terms of new features, but with the exception of revisions, attachments, and comments, the post API is now considered feature complete. Implementers can now expect that there won’t be any major changes to the post API.

Since you’ve all been so great, I’ve thrown in a bonus for this week. I’ve created a small proof-of-concept of extending the API for a multisite installation, which is now available via GitHub. Keep in mind that this is just a proof-of-concept, so it doesn’t have too much implemented. (This is also not covered under the scope of the GSOC project, so pull requests are most welcome!)

In the next couple of weeks, development will be focused around creating tests and example implementations. While this is occurring, I plan to also implement commenting, which was not in the original scope, but is still fairly important.

As always, feedback is welcome!

#gsoc, #gsoc2013, #json-api, #rest-api