metaweblog

How to create new post with photo attached in WordPress using XMLRPC?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 02:57:29
问题 Anyone knows how to create new post with photo attached in WordPress using XMLRPC? I am able to create new post and upload new picture separately, but looks like there is no way to attach the uploaded photo to the created post? Below is the codes I'm currently using. <?php DEFINE('WP_XMLRPC_URL', 'http://www.blog.com/xmlrpc.php'); DEFINE('WP_USERNAME', 'username'); DEFINE('WP_PASSWORD', 'password'); require_once("./IXR_Library.php"); $rpc = new IXR_Client(WP_XMLRPC_URL); $status = $rpc->query

How to create new post with photo attached in WordPress using XMLRPC?

自古美人都是妖i 提交于 2019-11-29 00:18:18
Anyone knows how to create new post with photo attached in WordPress using XMLRPC? I am able to create new post and upload new picture separately, but looks like there is no way to attach the uploaded photo to the created post? Below is the codes I'm currently using. <?php DEFINE('WP_XMLRPC_URL', 'http://www.blog.com/xmlrpc.php'); DEFINE('WP_USERNAME', 'username'); DEFINE('WP_PASSWORD', 'password'); require_once("./IXR_Library.php"); $rpc = new IXR_Client(WP_XMLRPC_URL); $status = $rpc->query("system.listMethods"); // method name if(!$status){ print "Error (".$rpc->getErrorCode().") : "; print