I don't see anything wrong with that in your case. The xmlrpc_call action is fired after logging in the requesting user ... so as long as you don't need to do anything <i>before</i> login, you should be just fine.<br>
<br><div class="gmail_quote">On Mon, Mar 21, 2011 at 1:46 PM, Muro, Matthew <span dir="ltr"><<a href="mailto:mmuro@advance.ua.edu">mmuro@advance.ua.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
See source here: <a href="http://plugins.trac.wordpress.org/browser/restrict-categories/trunk/restrict-categories.php" target="_blank">http://plugins.trac.wordpress.org/browser/restrict-categories/trunk/restrict-categories.php</a><br>
<br>
I'm adding it to line 50 in my __construct().<br>
<br>
For a regular browser, it's added through the admin_init action. For mobile app users, I'm using the xmlrpc_call action unless you think I need to use a different hook.<br>
<br>
Matthew Muro<br>
<div class="im"><br>
<br>
On Mar 21, 2011, at 3:40 PM, Eric Mann wrote:<br>
<br>
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.<br>
<br>
</div><div class="im">On Mon, Mar 21, 2011 at 1:34 PM, Muro, Matthew <<a href="mailto:mmuro@advance.ua.edu">mmuro@advance.ua.edu</a><mailto:<a href="mailto:mmuro@advance.ua.edu">mmuro@advance.ua.edu</a>>> wrote:<br>
Currently, I'm only running through the filters if is_admin() which might be why the filter isn't being applied.<br>
<br>
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.<br>
<br>
This is what I'm doing to handle xml-rpc:<br>
if ( defined ( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {<br>
add_action( 'xmlrpc_call', array( &$this, 'posts' ) );<br>
}<br>
<br>
In my posts function is where I'm setting the categories and hooking into the filters I mentioned above.<br>
<br>
Is there anything else I need to be checking for or will this cover it?<br>
<br>
Matthew<br>
<br>
Matthew,<br>
<br>
This really depends on which XML-RPC calls the mobile application is making.<br>
Off the top of my head, I'd think they were using `blogger.getRecentPosts`<br>
to get the blog's most recent posts. This method internally calls<br>
wp_get_recent_posts() which uses the get_posts() function to pull things<br>
from the database.<br>
<br>
This *should* be firing the pre_get_posts automatically. Is it not? Have<br>
you tried to trace the route of a request? What have you done so far to<br>
extend this functionality to users of the WordPress iOS app and what have<br>
been the results?<br>
<br>
Matthew Muro<br>
<br>
_______________________________________________<br>
wp-xmlrpc mailing list<br>
</div><a href="mailto:wp-xmlrpc@lists.automattic.com">wp-xmlrpc@lists.automattic.com</a><mailto:<a href="mailto:wp-xmlrpc@lists.automattic.com">wp-xmlrpc@lists.automattic.com</a>><br>
<div class="im"><a href="http://lists.automattic.com/mailman/listinfo/wp-xmlrpc" target="_blank">http://lists.automattic.com/mailman/listinfo/wp-xmlrpc</a><br>
<br>
</div><ATT00001..txt><br>
<div><div></div><div class="h5"><br>
_______________________________________________<br>
wp-xmlrpc mailing list<br>
<a href="mailto:wp-xmlrpc@lists.automattic.com">wp-xmlrpc@lists.automattic.com</a><br>
<a href="http://lists.automattic.com/mailman/listinfo/wp-xmlrpc" target="_blank">http://lists.automattic.com/mailman/listinfo/wp-xmlrpc</a><br>
</div></div></blockquote></div><br>