[wp-hackers] add_action for XML-RPC

Peter Westwood peter.westwood at ftwr.co.uk
Tue Mar 21 10:14:16 GMT 2006

On Tue, March 21, 2006 9:38 am, Sean Hickey wrote:
>   What I'm wondering is if anyone else thinks it would be a good idea
> to create action hook for registering plugin functions with WP's
> XML-RPC class?
>   Right now my plugin needs all of the WP's functions, variables,
> constants, etc. So I send request straight to the index.php script,
> let WP set everything up, and then it catches any incoming
> $HTTP_RAW_POST_DATA with the `init` filter.  If it thinks the POST is
> for the plugin, it takes it, otherwise lets WP go back to doing it's
> thing.
>   This is a hack that could be avoided if I could just register
> functions with the built in XML-RPC class.  Using something like
> add_action('xmlrpc-add', $myCallBackFunction);.
>   Obviously the popularity of XML-RPC keeps growing, and I can see
> more and more developers wanting something like this.  Just my opinion
> though.

Can you not use the xmlrpc_methods filter called in
http://trac.wordpress.org/file/branches/2.0/xmlrpc.php line 135 to add
your own methods to the builtin XML-RPC server?

This looks like it might help you achieve what you want.

An action here as well that was designed for you to just add to rather
than filter the method list could be an improvement but the existing
filter probably already provides all that is needed.

Peter Westwood <peter.westwood at ftwr.co.uk>

More information about the wp-hackers mailing list