WP REST API Query 01

First draft code version is out.

RESTify me!

Following along with my previous post I’ve put a draft version of the code on GitHub.
“RESTification” of a query comes in three different fashions:

  • adding the restify => true query variable to a WP_Query to get an array of WP_Post object each with the data property set to its own REST API response version.
  • using the restquery_Query class to spin up “RESTified” queries where each result is the data array.
  • using the restquery_get_posts function to get “RESTified” versions of the required posts.

Next

I will spin up a demonstrative theme to put the code into action and see if that’s a workable approach.