WordPress.org

Make WordPress Core

Ticket #5721: date_created_gmt__TRUNK.diff

File date_created_gmt__TRUNK.diff, 1.9 KB (added by markjaquith, 13 years ago)

For Trunk

  • xmlrpc.php

     
    12951295                        $to_ping = implode(' ', $to_ping);
    12961296
    12971297                // Do some timestamp voodoo
    1298                 $dateCreatedd = $content_struct['dateCreated'];
    1299                 if (!empty($dateCreatedd)) {
    1300                         $dateCreated = $dateCreatedd->getIso();
     1298                if ( !empty( $content_struct['date_created_gmt'] ) )
     1299                        $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force
     1300                elseif ( !empty( $content_struct['dateCreated']) )
     1301                        $dateCreated = $content_struct['dateCreated']->getIso();
     1302
     1303                if ( !empty( $dateCreated ) ) {
    13011304                        $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
    13021305                        $post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
    13031306                } else {
     
    15511554                $to_ping = $content_struct['mt_tb_ping_urls'];
    15521555                if ( is_array($to_ping) )
    15531556                        $to_ping = implode(' ', $to_ping);
    1554                
     1557
    15551558                // Do some timestamp voodoo
    1556                 $dateCreatedd = $content_struct['dateCreated'];
    1557                 if (!empty($dateCreatedd)) {
    1558                         $dateCreated = $dateCreatedd->getIso();
    1559                         $post_date     = get_date_from_gmt(iso8601_to_datetime($dateCreated));
    1560                         $post_date_gmt = iso8601_to_datetime($dateCreated . "Z", GMT);
     1559                if ( !empty( $content_struct['date_created_gmt'] ) )
     1560                        $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force
     1561                elseif ( !empty( $content_struct['dateCreated']) )
     1562                        $dateCreated = $content_struct['dateCreated']->getIso();
     1563
     1564                if ( !empty( $dateCreated ) ) {
     1565                        $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
     1566                        $post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
    15611567                } else {
    15621568                        $post_date     = $postdata['post_date'];
    15631569                        $post_date_gmt = $postdata['post_date_gmt'];