Providing the API documentation

Typically, most popular APIs provide complete documentation for accessing the API methods. Alternatively, we can use a new API method to provide details about all other API methods and parameters. This allows the third-party users to request an API method and get the details about all other functions.

Note

WordPress uses the API method named system.listMethods for listing all the existing methods inside the API. Here, we are going to go one step further by providing the API method parameters with the complete list.

We can start the process by adding another API method to the xml_rpc_api function, as shown in the following code:

public function xml_rpc_api($methods) { $methods['wpwa.subscribeToDevelopers'] = array($this, ...

Get WordPress Web Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.