[wp-hackers] How to exntend wp_xmlrpc_server in plugin

Martin Lazarov martin at lazarov.bg
Thu Aug 2 19:11:53 UTC 2012


That's the solution.

Thank you!

On Thu, Aug 2, 2012 at 9:55 PM, Otto <otto at ottodestruct.com> wrote:
> On Thu, Aug 2, 2012 at 1:05 PM, Martin Lazarov <martin at lazarov.bg> wrote:
>> I'm doing something wrong, but don't now what...
>>
>> So is loaded after plugin is loaded:
>> class-wp-xmlrpc-server.php is loaded in xmlrpc.php on line 55 and in
>> my plugin i can't do
>>
>> class my_xmlrpc_class extends wp_xmlrpc_server ...
>>
>> Is it posible?
>
> Yes. You need to hook to the wp_xmlrpc_server_class filter, define
> your class at the time that filter runs, and then return the name of
> the class.
>
> add_filter('wp_xmlrpc_server_class','my_class');
>
> function my_class($name) {
>
> class my_xmlrpc_class extends wp_xmlrpc_server {
> ... class stuff here ...
> }
>
> return 'my_xmlrpc_class';
> }
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list