WordPress.org

Make WordPress Core

Opened 8 years ago

Last modified 6 months 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.

https://dl.dropboxusercontent.com/u/1830109/wp-381-date.jpg

This should show the_modified_date = the_date in case of scheduled posts?

Thoughts?

Change History (9)

#1 follow-up: @knutsp
8 years ago

  • Keywords close added

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.

#2 follow-up: @wonderboymusic
6 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 @tushonline
6 years ago

Thanks for the update. Best wishes. Keep up the great work. ♥ WordPress.

#4 in reply to: ↑ 1 @uatania
3 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 @Rarst
3 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.

#6 @SergeyBiryukov
3 years ago

  • Milestone set to Awaiting Review

This ticket was mentioned in PR #1172 on WordPress/wordpress-develop by donmhico.


7 months ago

  • 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 @donmhico
7 months 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.

#9 @smerriman
6 months ago

I agree this is important. The default WordPress RSS feed uses post_modified for displaying the lastBuildDate. So if you're running a site where all posts are scheduled, lastBuildDate will often be days/weeks earlier than the most recent post in the feed. This cannot be correct.

Note: See TracTickets for help on using tickets.