Wordpress post via XMLRC -
in function
function wppostxmlrpc($title,$body,$rpcurl,$username,$password,$category,$keywords='',$encoding='utf-8') { $title = htmlentities($title,ent_noquotes,$encoding); $keywords = htmlentities($keywords,ent_noquotes,$encoding);
$content = array( 'title'=>$title, 'description'=>$body, 'mt_allow_comments'=>0, // 1 allow comments 'mt_allow_pings'=>0, // 1 allow trackbacks 'post_type'=>'post', 'mt_keywords'=>$keywords, 'categories'=>array($category) ); $params = array(0,$username,$password,$content,true); $request = xmlrpc_encode_request('metaweblog.newpost',$params); $ch = curl_init(); curl_setopt($ch, curlopt_postfields, $request); curl_setopt($ch, curlopt_url, $rpcurl); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_timeout, 1); $results = curl_exec($ch); curl_close($ch); return $results; }
question: metaweblog.newpost change ?
$request = xmlrpc_encode_request('metaweblog.newpost',$params);
refer :http://codex.wordpress.org/xml-rpc_wp
Comments
Post a Comment