Okay, so I discovered the answer to my question.
It is possible to filter the posts and categories that users see in their XML-RPC application. The pre_get_posts
and list_terms_exclusions
filters are called via the blogger.getRecentPosts XML-RPC method. Inside this function, it calls wp_get_recent_posts
which uses get_posts
. In other words, there's really nothing special you have to do if you are hooking into the above filters.
My problem was that for my plugin, I was only filtering while in the admin: if ( is_admin()
SOLUTION
In order to make sure it only fires when requested through an XML-RPC application, all you have to do is check for the XMLRPC_REQUEST constant and hook into the xmlrpc_call
action.
if ( defined ( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
add_action( 'xmlrpc_call', array( &$this, 'posts' ) );
}
Inside your callback, hook into the pre_get_posts
and list_terms_exclusions
filters.