Viewing 4 replies - 1 through 4 (of 4 total)
  • I have the same issue. Does anyone know how the original publish date can be preserved? Thanks in advance!

    Ran into this issue myself, and was able to figure it out.

    Look for the following, which is at line 266 in the current version.

    $post_data['post_type'] = $this->post['object']['post_type'];

    That retains the post_type when the post is edited. There are others similar issues, where the author can change to the user who edited it, and the comment status can be changed to closed. Here’s what I added to prevent all of the above from happening…

    $post_data['post_author'] = $this->post['object']['post_author'];
    $post_data['comment_status'] = $this->post['object']['comment_status'];
    $post_data['post_date'] = $this->post['object']['post_date'];
    $post_data['post_date_gmt'] = $this->post['object']['post_date_gmt'];

    Sweet! Thanks so much, Matt!

    Thread Starter newzoo

    (@newzoo)

    Superb! that did the trick! thank you Matt

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Publishdate gets reset when post is updated’ is closed to new replies.