zachfeldman / rubypress

Ruby interface for the WordPress XMLRPC API. Follows standard XML-RPC Documentation closely.
201 stars 55 forks source link

XML-RPC methods use static "wp." prefix #37

Closed botimer closed 9 years ago

botimer commented 9 years ago

The Client uses an unconditional prefix of "wp." to simplify the calls and because all of the standard API includes it. However, custom additions that do not start with this prefix cannot be called without overriding the entirety of the execute method.

A straightforward technique to retain the sane default behavior and allow custom methods to be called is to check whether the method called contains a dot and only apply the prefix if not, allowing literal method names to pass through unmodified.