Skip to content

Conversation

@himanshupathak95
Copy link

@himanshupathak95 himanshupathak95 commented Aug 17, 2025

Trac ticket: https://core.trac.wordpress.org/ticket/63835

When viewing the admin post/page listing, the "Date" column shows the "Last Modified" label for unpublished private posts, but incorrectly displays the post creation time instead of the actual modification time.

This patch fixes the issue by:

  • Determining upfront whether to show post time or modified time based on post status
  • Using get_the_modified_time() and get_post_modified_time() for unpublished posts
  • Maintaining consistent timestamp calculations for both display and time difference

All other statuses now correctly show the modified time when labeled "Last Modified".

@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@himanshupathak95 himanshupathak95 marked this pull request as ready for review August 18, 2025 13:21
@github-actions
Copy link

github-actions bot commented Aug 18, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props abcd95, circlecube.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@circlecube
Copy link

I reproduced this issue by creating a few pages and changing the publish date, and then saving as a draft (or scheduled). I indicated in the page title when the publish date is and when it was last modified. Here is the issue reproduced on core in latest on playground (not the PR code):
last-modified-page-core
The date this was created is 8/26, so yesterday refers to 8/25, but the post was just edited.

Then I opened the PR "Test in Playground" and created the same pages for this screenshot to show the changes to fix the issue. The posts now display the last modified date in favor of the publish date (even though they are not published):
last-modified-page-patched

This may be by design to show the "publish" data for draft posts, but if so, the label is incorrect. Not sure the best UX when a post has a publish date set, but the last modified date is different - should it show last modified or the desired publish date? Either way, though, either the label or the date data needs to be updated, since the label does not match the data. Either we need to update the date data, as this PR does to match the label of "Last Modified" or the label should be updated.

I think the last modified data is more relevant than the publish data since the page is not published yet (so publish date is irrelevant).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants