How to set the filter for wordpress xmlrpc wp.getPosts while using node.js? (NOT PHP)

I was wondering how to set the filter option for wp.getPosts. I want to get posts with a status of ‘trash’. is currently blank, and returns all posts other than trash.

I am using the xml-rpc wordpress api.

Read More

Here is my current code:

wpw.getPosts('<filter>', ['title','status'], function(err, data){

});

I am not sure what to put in the filter section, all the examples I could find are PHP examples and do not work in this context.

Is it even possible to get the posts with a status of ‘trash’?

Related posts

Leave a Reply

1 comment

  1. It is possible to get posts filtered by status. For the filter I added:

    {status:'trash'}
    

    This worked well. To get multiple status filters I just used an array:

    {status: ['trash','publish']}