WordPress.org

Make WordPress Core

Changeset 11625


Ignore:
Timestamp:
06/23/2009 04:24:13 PM (12 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.8/xmlrpc.php

    r11528 r11625  
    25742574            $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false);
    25752575            $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false);
     2576
     2577            // For drafts use the GMT version of the post date
     2578            if ( $postdata['post_status'] == 'draft' ) {
     2579                $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ) );
     2580                $post_date_gmt = preg_replace( '|\-|', '', $post_date_gmt );
     2581                $post_date_gmt = preg_replace( '| |', 'T', $post_date_gmt );
     2582            }
    25762583
    25772584            $categories = array();
Note: See TracChangeset for help on using the changeset viewer.