There are a couple of issues here. First of all, wp.editPost
takes a fourth parameter before the content struct -> the ID of the post you’re trying to edit (should be an integer).
Second, you’re passing a string for the post_date
, so the client automatically converts this to a <string>
tag before sending it to the server … unfortunately, the server expects a <dateTime.iso8601>
tag.
You can fix this by parsing the string date and passing an instance of the IXR_Date
class instead. The client will parse it properly and the server will react appropriately. I’ve tested the following scenario on my own server:
$date = new IXR_Date( strtotime( $post->post_date ) ); // Parse the date to an IXR_Date object.
$response = $client->query(
'wp.editPost',
array(
0,
$user,
$pwd,
$post_id,
array(
'post_date' => $date
)
)
);