[wp-trac] [WordPress Trac] #14814: Allow WP XML-RPC Library to be Extended

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 8 23:29:37 UTC 2010

#14814: Allow WP XML-RPC Library to be Extended
 Reporter:  filosofo      |       Owner:  filosofo 
     Type:  defect (bug)  |      Status:  assigned 
 Priority:  normal        |   Milestone:  3.1      
Component:  XML-RPC       |     Version:  3.1      
 Severity:  normal        |    Keywords:  has-patch

Comment(by Denis-de-Bernardy):

 Replying to [comment:12 filosofo]:
 > Really, I'm not principally interested in ''replacing'' the
 `wp_xmlrpc_server` class, as I can already (and am forced to) do that; I
 want to extend it.  That part of the patch was a offhand enhancement,
 which maybe I shouldn't have included for simplicity's sake.

 Please bear with me. My suggestion is merely a bit more versatile than
 what the patch suggests. Consider:

 if ( ! empty( $xmlrpc_server_class ) && class_exists( $xmlrpc_server_class
 ) ) {
     $wp_xmlrpc_server = new $xmlrpc_server_class;

 vs. my suggested, less conflict prone and even more pluginable suggestion:

 $xmlrpc_server_class = apply_filters('xmlrpc_server_class',
 $wp_xmlrpc_server = new $xmlrpc_server_class;

 in the suggested patch, anyone can override the global and whoever comes
 last in alphabetical plugin order trumps. in my own suggest, whoever goes
 last as far as priority is concerned does. extending or whatever has
 nothing to do with it. you can extend in either case as needed.

Ticket URL: <http://core.trac.wordpress.org/ticket/14814#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list