I’m trying to set the post_date
of a blog post to WordPress via XMLRPC.
I’m sending the data as a string:
$pubdate = '2010-04-08 13:46:43';
'post_date'=>$pubdate,
It appears 'post_date'
is correct?
I also found this post losely related to the issue: http://wordpress.org/support/topic/330597
Can anyone suggest how I would post the date as: dateTime.iso8601
Have you tried this ?
http://www.php.net/manual/en/function.strtotime.php
http://www.php.net/manual/en/function.date.php
To post the date as a
<dateTime.iso8601>
element (assuming you’re using the built-in XML-RPC client within WordPress, you want to cast your date as anIXR_Date
object.Now, when you pass your array of arguments to make the request, passing
'pub_date' => $pubdate
will create the correct XML element.See this other answer to a similar question for more information if you want a full, working example.