0
$content = array(
'post_title' => $title,
'post_content' => $body,
'post_status' => 'publish',
'post_date' => $pub_date //What's the proper format for the date here?
)
$params = array(0,$this->settings['username'],$this->settings['password'],$content);
$request = xmlrpc_encode_request('wp.newPost',$params);
$this->Curl->post($this->controller->rpc_url,$request);
我已經嘗試了post_date格式許多不同的變化,並沒有他們工作。這裏是所有的,我已經嘗試過的組合和他們都不工作:WordPress的XMLRPC(wp.newPost) - 無法獲得post_date格式正確
1) $pub_date = date('Y-m-d H:i:s', time());
2) $pub_date = time();
3) $pub_date = new IXR_Date(time());
4) $pub_date = date('c',time());
5) $datetime = new DateTime('2010-12-30 23:21:46');
$pub_date = $datetime->format(DateTime::ISO8601);
好像我嘗試了所有可能的解決方案,它仍然不希望發佈每當我嘗試包括POST_DATE。有人可以幫忙,我真的被困在這一個。