These are chat archives for WP-API/node-wpapi

10th
Feb 2017
David Lawson
@dlawson
Feb 10 2017 21:27

Hey Kadam!

I'm wondering if it's possible to take a wpapi call like:

wp.posts().author.(5).status( 'publish' );

And make it work more like this:

wp.query({
     post_type: 'post',
     author: 5,
     status: 'publish'
});

My application is set up so that my API object does not know ahead of time what the query will be. I need to be able to dynamically build the API query based on parameters passed to it.

Thank you!