• I’m working on a plugin that will change the dates of posts. My code works well for just about every post I’ve tested, but when I try to change the date of a draft that is marked as “Publish Immediately” in the UI nothing happens. I don’t get any errors, but when I try to get the new date on the post I just get the old one. I’m using wp_update_post.

    Does anyone know if there is a special field I have to set in this case? Is there an example I could look at?

    Thanks in advance for the help,
    Zack

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Zack Grossbart

    (@zgrossbart)

    I was able to find a solution to this issue by looking at the implementation of publishing posts in post.php. If I set a value for edit_date in my post before I call wp_update_post everything works. I’m curious if this is the right change. Has anyone else tried this?

    Thanks,
    Zack

    Hi Zack–

    Is this still working for you? I’m having the same problem you described.

    Can you write out how you set the value for edit_date?

    many thanks
    Gloria

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change the date of a “publish immediately” draft’ is closed to new replies.