November 2013
Beginner to intermediate
376 pages
9h
English
Custom APIs are essential for adding web application specific behaviors, which goes beyond the generic blogging functionality. We need the implementation for both the server and client to create a custom API. Here, we are going to build an API function that outputs the list of developers in a portfolio application. As usual, we are going to get started by creating another plugin folder named wpwa-xml-rpc-api with the main file named class-wpwa-xml-rpc-api.php.
Let's look at the initial code to build the API server:
class WPWA_XML_RPC_API { public function __construct() { add_filter('xmlrpc_methods', array($this, 'xml_rpc_api')); } public function xml_rpc_api($methods) { $methods['wpwa.getDevelopers'] = array($this, 'developers_list'); ...Read now
Unlock full access