#46933 closed enhancement (wontfix)
Re-publishing a drafted post does not update post_date in database
Reported by: | subrataemfluence | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | trivial | Version: | |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
I am not sure if this is a bug really! But when I re-published a drafted post I have seen the modified_date
changes but post_date
does not.
How I tested:
- Created a post (Post-1) and saved as
Draft
. - Edited it and
Published
. Bothpost_date
andpost_modified
get updated. - Created a new post (Post-2) and
Published
it. Bothpost_date
andpost_modified
dates are same, which is fine. - Edited and switched it back to
Draft
mode.post_modified
got updated. - Then again edited to
Publish
it. Onlypost_modified
column got updated.
In short, if I publish a post which was originally saved as draft, both date columns are getting updated, but the behavior is different if I re-publish a post which was originally Published and then switched back to Draft mode.
Has this been done in purpose so that the once a post is published its post_date
will not update (unless I change it via Quick Edit)?
The question is when a post can be re-published, why not the recent publish date gets saved in the database.
Since I am not sure if this is a bug, I am setting the type as Enhancement
.
Change History (2)
Note: See
TracTickets for help on using
tickets.
For me it's a normal behaviour.
The post_date is the original published post date, and you can rely on the post_modifed date to know if there is a more recent version of the current post. You find a lot of tutorials to allow you to display the last modified post date in post page (frontend) instead of just the post date for example. https://www.wpbeginner.com/wp-tutorials/display-the-last-updated-date-of-your-posts-in-wordpress/