Support » Fixing WordPress » XML-RPC API wp.getPosts custom filter

  • 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?

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘XML-RPC API wp.getPosts custom filter’ is closed to new replies.