[wp-xmlrpc] Possible to filter posts users see in their mobile app?

Eric Mann eric at eam.me
Mon Mar 21 20:40:32 UTC 2011


Nothing sticks out.  Give it a try from a couple of different systems (iOS
app, Android app if you have it, another XML-RPC interface).  But if it
works with one, it should work with all of them.  Where are you doing the
check for the XMLRPC_REQUEST constant?  My only concern would be that the
check itself might be missed somehow if it lives in the wrong part of the
code or is used on the wrong hook.

On Mon, Mar 21, 2011 at 1:34 PM, Muro, Matthew <mmuro at advance.ua.edu> wrote:

> 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
>
> _______________________________________________
> wp-xmlrpc mailing list
> wp-xmlrpc at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-xmlrpc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.automattic.com/pipermail/wp-xmlrpc/attachments/20110321/825c4e4d/attachment.htm>


More information about the wp-xmlrpc mailing list