Why is $wp_xmlrpc_server->minimum_args
protected? It seems like as much of a utility method as $wp_xmlrpc_server->login
. Is there some other way to sanitize the inputs for length or do I have to write my own method?
Leave a Reply
You must be logged in to post a comment.
You can totally swap out the class that runs the xmlrpc server. So create a subclass of
wp_xmlrpc_server
, use it for the xmlrpc server class, and use all the protected methods you like.Example (not tested, use with caution):
To answer your question, it’s protected because it’s meant to be an internal method. There would be no reason for someone outside the
wp_xmlrpc_server
class to use that method, so there’s no reason for it to be public. Furthermore, the way it’s implemented may cause unintentional side effects (like an error being set/sent) if it was used by an untrusted source — eg. someone outside thewp_xmlrpc_server
class.