Returns a list of available methods.
WordPress 2.0+
None
<methodCall> <methodName>system.listMethods</methodName> <params></params> </methodCall>
<methodResponse> <params> <param> <value> <array><data> <value> <string>system.multicall</string> </value> <value> <string>system.listMethods</string> </value> <value> <string>system.getCapabilities</string> </value> <value> <string>demo.multiplyTwoNumbers</string> </value> <value> <string>demo.addTwoNumbers</string> </value> <value> <string>demo.sayHello</string> </value> <value> <string>pingback.extensions.getPingbacks</string> </value> <value> <string>pingback.ping</string> </value> <value> <string>mt.publishPost</string> </value> <value> <string>mt.getTrackbackPings</string> </value> <value> <string>mt.supportedTextFilters</string> </value> <value> <string>mt.supportedMethods</string> </value> <value> <string>mt.setPostCategories</string> </value> <value> <string>mt.getPostCategories</string> </value> <value> <string>mt.getRecentPostTitles</string> </value> <value> <string>mt.getCategoryList</string> </value> <value> <string>metaWeblog.getUsersBlogs</string> </value> <value> <string>metaWeblog.setTemplate</string> </value> <value> <string>metaWeblog.getTemplate</string> </value> <value> <string>metaWeblog.deletePost</string> </value> <value> <string>metaWeblog.newMediaObject</string> </value> <value> <string>metaWeblog.getCategories</string> </value> <value> <string>metaWeblog.getRecentPosts</string> </value> <value> <string>metaWeblog.getPost</string> </value> <value> <string>metaWeblog.editPost</string> </value> <value> <string>metaWeblog.newPost</string> </value> <value> <string>blogger.deletePost</string> </value> <value> <string>blogger.editPost</string> </value> <value> <string>blogger.newPost</string> </value> <value> <string>blogger.setTemplate</string> </value> <value> <string>blogger.getTemplate</string> </value> <value> <string>blogger.getRecentPosts</string> </value> <value> <string>blogger.getPost</string> </value> <value> <string>blogger.getUserInfo</string> </value> <value> <string>blogger.getUsersBlogs</string> </value> <value> <string>wp.getCommentStatusList</string> </value> <value> <string>wp.newComment</string> </value> <value> <string>wp.editComment</string> </value> <value> <string>wp.deleteComment</string> </value> <value> <string>wp.getComments</string> </value> <value> <string>wp.getComment</string> </value> <value> <string>wp.setOptions</string> </value> <value> <string>wp.getOptions</string> </value> <value> <string>wp.getPageTemplates</string> </value> <value> <string>wp.getPageStatusList</string> </value> <value> <string>wp.getPostStatusList</string> </value> <value> <string>wp.getCommentCount</string> </value> <value> <string>wp.uploadFile</string> </value> <value> <string>wp.suggestCategories</string> </value> <value> <string>wp.deleteCategory</string> </value> <value> <string>wp.newCategory</string> </value> <value> <string>wp.getTags</string> </value> <value> <string>wp.getCategories</string> </value> <value> <string>wp.getAuthors</string> </value> <value> <string>wp.getPageList</string> </value> <value> <string>wp.editPage</string> </value> <value> <string>wp.deletePage</string> </value> <value> <string>wp.newPage</string> </value> <value> <string>wp.getPages</string> </value> <value> <string>wp.getPage</string> </value> <value> <string>wp.getUsersBlogs</string> </value> </data></array> </value> </param> </params> </methodResponse>
<?php require ABSPATH . WPINC . "/class-IXR.php"; $rpc = new IXR_Client( "http://example.com/xmlrpc.php" ); $status = $rpc->query( "system.listMethods" // method name ); if( !$status ) { print "Error ( " . $rpc->getErrorCode( ) . " ) : "; print $rpc->getErrorMessage( ) . "\n"; exit; } $data = $rpc->getResponse( ); print_r( $data ); ?>
In WordPress specifically (as opposed to vanilla PHP), there is a class available that uses WordPress' built-in HTTP request wrapper instead of relying on direct cURL calls. To use this wrapper, your code instead becomes:
<?php require ABSPATH . WPINC . "/class-IXR.php"; require ABSPATH . WPINC . "/class-wp-http-ixr-client.php"; $rpc = new WP_HTTP_IXR_Client( "http://example.com/xmlrpc.php" ); $status = $rpc->query( "system.listMethods" // method name ); if( !$status ) { print "Error ( " . $rpc->getErrorCode( ) . " ) : "; print $rpc->getErrorMessage( ) . "\n"; exit; } $data = $rpc->getResponse( ); print_r( $data ); ?>