#6483 closed defect (bug) (invalid)
Using mt.publishPost results in posts having date of November 30th, 1999
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 2.3.3 |
Component: | XML-RPC | Keywords: | mt.publishPost publishPost xmlrpc |
Focuses: | Cc: |
Description
I am guessing that the functionality of mt.publishPost should be analogous to that of clicking "Publish" on the standard WordPress "Manage" > "Posts" screen.
Creating a draft post in WordPress, then publishing it using mt.publishPost however results in the post having the date of "November 30th, 1999" rather than the current date as it would when using the GUI.
Change History (6)
#2
@
17 years ago
Please see below:
POST /wordpress/xmlrpc.php HTTP/1.0 Host: server Content-Type: text/xml User-Agent: The Incutio XML-RPC PHP Library Content-length: 260 <?xml version="1.0"?> <methodCall> <methodName>mt.publishPost</methodName> <params> <param><value><int>27</int></value></param> <param><value><string>admin</string></value></param> <param><value><string>admin</string></value></param> </params></methodCall> <?xml version="1.0"?> <methodResponse> <params> <param> <value> <int>27</int> </value> </param> </params> </methodResponse>
I am using the Incutio XML-RPC PHP Library from http://scripts.incutio.com/xmlrpc/IXR_Library.inc.php.txt
<?php include "http://scripts.incutio.com/xmlrpc/IXR_Library.inc.php.txt"; // Create the client object $client = new IXR_Client('http://server/wordpress/xmlrpc.php'); $client->debug=true; // Run a query for PHP if (!$client->query('mt.publishPost', 27, 'admin', admin)) { die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage()); } // Display the result echo '<pre>'; print_r($client->getResponse()); echo '</pre>'; ?>
#3
@
17 years ago
What we need is the request that created the post. The only thing that mt.publishPost does is to publish an existing post.
#4
@
17 years ago
i could fix that by using
<pubDate>
<?php echo mysql2date('r', get_the_time('Y-m-d H:i:s')); ?>
</pubDate>
instead of
<pubDate>
<?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?>
</pubDate>
in feed-rss2.php e.g.
But i do not think that is the right solution, just my workaround for my blogs and maybe i`m totally wrong here.. then sorry of course! ;)
Can you provide the exact contents of the XML-RPC request and response?