XML-RPC API wp.getPosts custom filter (2 posts)

  1. Angel S. Moreno
    Posted 3 years ago #

    I have successfully created a script for accessing WP content via the XML-RPC API. While doing tests, I noticed I am limited to specific fields which can be filtered. I am curious to know if there is another way to do something like this:

    $filter = array(
         'sticky' => true,
         'post_type' => 'post',
         'post_status' => 'publish'
    $MyClass->query('wp.getPosts', $filter);

    Currently, the XML-RPC server is ignoring all filter keys that are not the ones specifically mentioned in the API's documentation. Is there any around this without having to created a plugin to extend the API?

  2. Thiago Fernandes
    Posted 2 years ago #

    Yes, not possible.

    Fastest solution is to install the Entended API plugin and use its methods to query your data.

    There's a small fix you need to make in the main.php line 65. Just remove the & from the $args variable.

    Use at your own risk.

Topic Closed

This topic has been closed to new replies.

About this Topic