[wp-xmlrpc] Possible to filter posts users see in their mobile app?
Muro, Matthew
mmuro at advance.ua.edu
Mon Mar 21 20:34:34 UTC 2011
Currently, I'm only running through the filters if is_admin() which might be why the filter isn't being applied.
I just added a check for the XMLRPC_REQUEST constant, manually filtered pre_get_posts and list_terms_exclusions and the posts/categories were properly restricted.
This is what I'm doing to handle xml-rpc:
if ( defined ( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
add_action( 'xmlrpc_call', array( &$this, 'posts' ) );
}
In my posts function is where I'm setting the categories and hooking into the filters I mentioned above.
Is there anything else I need to be checking for or will this cover it?
Matthew
Matthew,
This really depends on which XML-RPC calls the mobile application is making.
Off the top of my head, I'd think they were using `blogger.getRecentPosts`
to get the blog's most recent posts. This method internally calls
wp_get_recent_posts() which uses the get_posts() function to pull things
from the database.
This *should* be firing the pre_get_posts automatically. Is it not? Have
you tried to trace the route of a request? What have you done so far to
extend this functionality to users of the WordPress iOS app and what have
been the results?
Matthew Muro
More information about the wp-xmlrpc
mailing list