WP REST API Query 01
April 19, 2016
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 => truequery variable to aWP_Queryto get an array ofWP_Postobject each with thedataproperty set to its own REST API response version. - using the
restquery_Queryclass to spin up "RESTified" queries where each result is thedataarray. - using the
restquery_get_postsfunction 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.