开发者 | |
---|---|
更新时间 | 2013年1月10日 23:04 |
PHP版本: | 3.3 及以上 |
WordPress版本: | 3.3.1 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
/wp-content/plugins/
directory//this example demo how to invoke the api to delete a image in the album set_time_limit(0); require_once("IXR_Library.php.inc"); $client->debug = true; // Set it to false in Production Environment // Create the client object $client = new IXR_Client('{zonename}','/xmlrpc.php?delete_images[]={imageID}'); $username = "{admin login name}"; $password = "{password}"; $function_args = array(array('',$username,$password,'{postID}', array())); $params = array($username,$password,"i_gllrxmlrpc_editpost", $function_args); // Run a query To Read Posts From Wordpress $ret = $client->query('gllrxmlrpc_extapi.callGllrMethod', $params); if (!$ret) { die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage()); } $myresponse = $client->getResponse(); print_r($myresponse);
client = new XMLRPCClient(WordPress.currentBlog.getUrl(), WordPress.currentBlog.getHttpuser(), WordPress.currentBlog.getHttppassword()); Object[] result = null; // Map gallery_type = new HashMap(); gallery_type.put("post_type", "gallery"); //String[] return_fields = {"post_title", "post_type"}; Object[] fArgs = {"", WordPress.currentBlog.getUsername(),WordPress.currentBlog.getPassword(),gallery_type}; Object[] funcArgs = {fArgs}; // Object[] params = { WordPress.currentBlog.getUsername(), WordPress.currentBlog.getPassword(), "i_gllrxmlrpc_metaweblog_getposts", funcArgs }; try { result = (Object[]) client.call("gllrxmlrpc_extapi.callGllrMethod", params); } catch (XMLRPCException e) { errorMsg = e.getMessage(); }
debug = true; // Set it to fase in Production Environment // Create the client object $client = new IXR_Client('hushanqi.localhost','/xmlrpc.php?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=13505726480152'); $username = "{user name}"; $password = "{password}"; $function_args = array(array('',$username,$password,'99')); $params = array($username,$password,"i_gllrxmlrpc_deletepost", $function_args); // Run a query To Read Posts From Wordpress if (!$client->query('gllrxmlrpc_extapi.callGllrMethod', $params)) { die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage()); } $myresponse = $client->getResponse(); print_r($myresponse); die(); ?>