WordPress.org

Make WordPress Core

Ticket #19715: edit_date.patch

File edit_date.patch, 1.5 KB (added by jmartindf, 6 years ago)

Make the XML-RPC interface send the edit_date flag.

  • wp-includes/class-wp-xmlrpc-server.php

    old new  
    24812481         * @param array $args Method parameters.
    24822482         * @return bool True on success.
    24832483         */
    2484         function mw_editPost($args) {
     2484  function mw_editPost($args) {
     2485    $edit_date = 0;
    24852486
    24862487                $this->escape($args);
    24872488
     
    27052706
    27062707                if ( !empty( $dateCreated ) ) {
    27072708                        $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
    2708                         $post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT');
     2709      $post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT');
     2710      $edit_date = 1;
    27092711                } else {
    27102712                        $post_date     = $postdata['post_date'];
    27112713                        $post_date_gmt = $postdata['post_date_gmt'];
    2712                 }
     2714    }
    27132715
    27142716                // We've got all the data -- post it:
    2715                 $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');
     2717                $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');
    27162718
    27172719                $result = wp_update_post($newpost, true);
    27182720                if ( is_wp_error( $result ) )