Gravity Forms - Update Post
[resolved] Publishdate gets reset when post is updated (5 posts)

  1. newzoo
    Posted 2 years ago #

    Hi there,

    Whenever a post gets updated, the publishdate of that particular posts gets updated. Is there anyway to bypass this action? i want to be able to update a post without changing the published date...


  2. Timidyo
    Posted 2 years ago #

    I have the same issue. Does anyone know how the original publish date can be preserved? Thanks in advance!

  3. Matt Brett
    Posted 2 years ago #

    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'];
  4. Timidyo
    Posted 2 years ago #

    Sweet! Thanks so much, Matt!

  5. newzoo
    Posted 2 years ago #

    Superb! that did the trick! thank you Matt

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Gravity Forms - Update Post
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.