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 aWP_Query
to get an array ofWP_Post
object each with thedata
property set to its own REST API response version. - using the
restquery_Query
class to spin up “RESTified” queries where each result is thedata
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.