Opened 11 years ago
Last modified 4 years ago
#26980 reopened defect (bug)
the_modified_date is lower than the_date when post is scheduled
Reported by: | tushonline | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | Date/Time | Keywords: | has-patch |
Focuses: | Cc: |
Description
I scheduled a post on 30th Jan for 1st Feb. When the post was published, the modified date shows lower than the published date.
I am using <?php the_date('F j, Y'); ?>
for first part & <?php the_modified_date('F j, Y'); ?>
for the second part.
This should show the_modified_date = the_date in case of scheduled posts?
Thoughts?
Change History (9)
#2
follow-up:
↓ 3
@
9 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
Thanks for the report, @tushonline. Closing this since there's been no activity in 20 months. I agree with @knutsp's remarks in comment:1
#3
in reply to:
↑ 2
@
9 years ago
Thanks for the update. Best wishes. Keep up the great work. ♥ WordPress.
#4
in reply to:
↑ 1
@
6 years ago
- Resolution wontfix deleted
- Status changed from closed to reopened
Replying to knutsp:
I have no problem accepting that a post is modified before it's published. The automated publishing itself is not a modification. Only humans should be able modify.
I disagree because the modified date often it's used as data in some feeds and sitemaps where this can be treated as an error.
(Sorry for reopening the discussion a lot of years later.)
#5
@
6 years ago
- Keywords needs-patch added; close removed
I think that discrepancy between "human" and code modification of post instance can be very confusing in this and other instances.
Tentatively my opinion is that we should aim to "any change is a change" handling of it to maximize consistency.
This ticket was mentioned in PR #1172 on WordPress/wordpress-develop by donmhico.
4 years ago
#7
- Keywords has-patch added; needs-patch removed
This PR updates the post_modified
and post_modified_gmt
to post_date
and post_date_gmt
respectively when publishing new post.
Trac ticket: https://core.trac.wordpress.org/ticket/26980
#8
@
4 years ago
I've attached a PR which updates post_modified
and post_modified_gmt
to post_date
and post_date_gmt
when publishing a scheduled post.
I agree with @uatania. I've seen feed reader / apis which uses post modified date.
My PR changes are inside wp_publish_post()
since aside from transitioning scheduled post to published, i don't see any other use case of wp_publish_post()
where this new change could potentially break something. Another set of eyes is more than welcome in case I missed something.
I have no problem accepting that a post is modified before it's published. The automated publishing itself is not a modification. Only humans should be able modify.