[wp-hackers] add_action for XML-RPC

Sean Hickey seanhickey at gmail.com
Tue Mar 21 12:52:14 GMT 2006


Well of course you were right.  Good thing I brought this up, cause it
keeps my plugin from feeling "hackish", and instead it's using defined
APIs within WordPress.

Thanks!
- Sean

On 3/21/06, Peter Westwood <peter.westwood at ftwr.co.uk> wrote:
>
> 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
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


--
http://www.headzoo.com


More information about the wp-hackers mailing list