[wp-hackers] add_action for XML-RPC

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


On Tue, March 21, 2006 11:56 am, Sean Hickey wrote:
> I already tried using it like this:
>
> add_filter('xmlrpc_methods', array('myplug.ping' => 'myplug_ping'));
> function myplug_ping($args) {
> 	return $args;
> }

This code is wrong - you have to give add_filter a function name to call
and it will pass you the variable to filter in that function.

I think you want something more like this fragment

---
add_filter('xmlrpc_methods', 'myplug_register_functions');

function myplug_register_functions($xmlrpc_methods) {
    $my_funcs = array('myplug.ping' => 'myplug_ping');
    return array_merge($xmlrpc_methods,$my_funcs);
}

function myplug_ping($args) {
    return $args;
}
---

>
> And it didn't do anything.  The only place that "xmlrpc_methods" is
> even mentioned in the docs is under Skippy's page, and there it's only
> listed, no description.
>

I have added xmlrpc_methods to the list of filters on the Plugin API page.

westi
-- 
Peter Westwood <peter.westwood at ftwr.co.uk>
http://blog.ftwr.co.uk


More information about the wp-hackers mailing list