WordPress.org

Make WordPress Core

Changeset 19883


Ignore:
Timestamp:
02/08/2012 11:25:11 PM (6 years ago)
Author:
josephscott
Message:

Expose the post modified date (in blog TZ and GMT) via XML-RPC

Props ocollet
Fixes #19027

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r19879 r19883  
    33933393            $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false);
    33943394            $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false);
     3395            $post_modified = mysql2date('Ymd\TH:i:s', $postdata['post_modified'], false);
     3396            $post_modified_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_modified_gmt'], false);
    33953397
    33963398            // For drafts use the GMT version of the post date
    3397             if ( $postdata['post_status'] == 'draft' )
     3399            if ( $postdata['post_status'] == 'draft' ) {
    33983400                $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ), 'Ymd\TH:i:s' );
     3401                $post_modified_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_modified'] ), 'Ymd\TH:i:s' );
     3402            }
    33993403
    34003404            $categories = array();
     
    34723476                'custom_fields' => $this->get_custom_fields($post_ID),
    34733477                'wp_post_format' => $post_format,
    3474                 'sticky' => $sticky
     3478                'sticky' => $sticky,
     3479                'date_modified' => new IXR_Date( $post_modified ),
     3480                'date_modified_gmt' => new IXR_Date( $post_modified_gmt )
    34753481            );
    34763482
     
    35193525            $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false);
    35203526            $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false);
     3527            $post_modified = mysql2date('Ymd\TH:i:s', $entry['post_modified'], false);
     3528            $post_modified_gmt = mysql2date('Ymd\TH:i:s', $entry['post_modified_gmt'], false);
    35213529
    35223530            // For drafts use the GMT version of the date
    3523             if ( $entry['post_status'] == 'draft' )
     3531            if ( $entry['post_status'] == 'draft' ) {
    35243532                $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' );
     3533                $post_modified_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_modified'] ), 'Ymd\TH:i:s' );
     3534            }
    35253535
    35263536            $categories = array();
     
    35813591                'post_status' => $entry['post_status'],
    35823592                'custom_fields' => $this->get_custom_fields($entry['ID']),
    3583                 'wp_post_format' => $post_format
     3593                'wp_post_format' => $post_format,
     3594                'date_modified' => new IXR_Date( $post_modified ),
     3595                'date_modified_gmt' => new IXR_Date( $post_modified_gmt )
    35843596            );
    35853597
Note: See TracChangeset for help on using the changeset viewer.