WordPress.org

Make WordPress Core

Ticket #16985: 16985.3.patch

File 16985.3.patch, 1.5 KB (added by SergeyBiryukov, 6 years ago)
  • wp-includes/class-wp-xmlrpc-server.php

     
    41444144                        $dateCreated = $content_struct['dateCreated']->getIso();
    41454145
    41464146                if ( !empty( $dateCreated ) ) {
    4147                         $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
    4148                         $post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT');
     4147                        $post_date = get_date_from_gmt( iso8601_to_datetime( $dateCreated ) );
     4148                        $post_date_gmt = iso8601_to_datetime( $dateCreated, 'GMT' );
     4149                        $edit_date = true;
    41494150                } else {
    41504151                        $post_date     = $postdata['post_date'];
    41514152                        $post_date_gmt = $postdata['post_date_gmt'];
     4153                        $edit_date = false;
    41524154                }
    41534155
    41544156                // We've got all the data -- post it:
    4155                 $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template');
     4157                $newpost = compact( 'ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template', 'edit_date' );
    41564158
    41574159                $result = wp_update_post($newpost, true);
    41584160                if ( is_wp_error( $result ) )