Make WordPress Core


Ignore:
Timestamp:
07/10/2014 02:16:20 PM (12 years ago)
Author:
westi
Message:

XMLRPC: Restore support in wp.newPost for dates to be supplied in the structured dateTime.iso8601 format as well as still supporting dates specified as strings.

Fixes #28601.

File:
1 edited

Legend:

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

    r28854 r29063  
    11041104
    11051105        // convert the date field back to IXR form
    1106         if ( isset( $content_struct['post_date'] ) ) {
     1106        if ( isset( $content_struct['post_date'] ) && ! is_a( $content_struct['post_date'], 'IXR_Date' ) ) {
    11071107            $content_struct['post_date'] = $this->_convert_date( $content_struct['post_date'] );
    11081108        }
     
    11101110        // ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct,
    11111111        // since _insert_post will ignore the non-GMT date if the GMT date is set
    1112         if ( isset( $content_struct['post_date_gmt'] ) ) {
     1112        if ( isset( $content_struct['post_date_gmt'] ) && ! is_a( $content_struct['post_date_gmt'], 'IXR_Date' ) ) {
    11131113            if ( $content_struct['post_date_gmt'] == '0000-00-00 00:00:00' || isset( $content_struct['post_date'] ) ) {
    11141114                unset( $content_struct['post_date_gmt'] );
Note: See TracChangeset for help on using the changeset viewer.