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
This commit is contained in:
Ryan Boren 2009-06-23 16:23:49 +00:00
parent 119195fda1
commit adf22ff2e7
1 changed files with 7 additions and 0 deletions

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)