I have a plugin which echoes something before the content on webpage. Normally I don’t want it on feeds so I do this
if ( ! is_admin() && ! is_feed() )
echo $script;
Now, when some one uses xmlrpc calls to get the posts, there is nothing I could check against to prevent my script geting echoed into the post. Is there any thing like is_xmlrpc() to check this?
Thanks in advance for any help!
Not really, but you could create it yourself pretty easily (and I really suggest to wrap that into a function because the detection is not overly stable and you might need to change it):
This works because in
xmlrpc.php
at the very top thatXMLRPC_REQUEST
constant is being defined.