Return correct date in date_created_gmt field. Props josephscott. fixes #10244 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@11624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-06-23 16:23:49 +00:00
parent 090bee02ab
commit 8d00b22c40

View File

@ -2574,6 +2574,13 @@ class wp_xmlrpc_server extends IXR_Server {
$post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false);
$post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false);
// For drafts use the GMT version of the post date
if ( $postdata['post_status'] == 'draft' ) {
$post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ) );
$post_date_gmt = preg_replace( '|\-|', '', $post_date_gmt );
$post_date_gmt = preg_replace( '| |', 'T', $post_date_gmt );
}
$categories = array();
$catids = wp_get_post_categories($post_ID);
foreach($catids as $catid)