From adf22ff2e7bb556e8a7256f52027fc47dbc79ea7 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 23 Jun 2009 16:23:49 +0000 Subject: [PATCH] Return correct date in date_created_gmt field. Props josephscott. fixes #10244 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@11624 602fd350-edb4-49c9-b593-d223f7449a82 --- xmlrpc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xmlrpc.php b/xmlrpc.php index 55279426cb..85d3a4ed84 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -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)