Opened 9 years ago
Last modified 3 months ago
#40860 new defect (bug)
Post that is "Pending Review" and Scheduled shows incorrect "Last Modified" date in Post Listing
| Reported by: | yearginsm | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Posts, Post Types | Version: | |
| Severity: | normal | Keywords: | good-first-bug has-test-info has-patch has-unit-tests |
| Cc: | Focuses: | administration |
Description
Reproduction steps:
- Create a new post
- Schedule the post for a date in the future
- Set the status to "Pending Review"
- Save the post
- Return to Posts listing
- Observe that the "Date" column has an incorrect "Last Modified" flag
Attachments (4)
Change History (12)
#1
@
9 years ago
- Component General → Posts, Post Types
- Keywords needs-patch added
- Milestone Awaiting Review → Future Release
- Priority normal → low
Good find. I can replicate it just showing the date. As this screenshot shows, the saved post shows a different thing.
I do agree it should be consistent, either way. My advice would be to show time ago like a saved post.
#2
@
9 years ago
- Focuses accessibility added; ui removed
- Keywords has-patch added; needs-patch removed
I have added the patch to show the post modified date when the post status is draft or pending review.
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by sirlouen. View the logs.
12 months ago
#6
@
12 months ago
- Keywords needs-patch good-first-bug has-test-info added; has-patch removed
- Priority low → normal
- Version 4.7.5
Reproduction Report
Description
✅ This report validates that the issue can still be reproduced.
Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.29
- Server: nginx/1.29.1
- Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
- Browser: Chrome 140.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.3
- MU Plugins: None activated
- Plugins:
- AAA Testing Dolly
- Health Check & Troubleshooting 1.7.1
- Micro Email Testing 1.0.0
- Test Reports 1.2.0
Testing Instructions
- The ones provided in the OP
Actual Results
- ✅ Error condition occurs (reproduced).
Additional Notes
- The patch is not applying anymore, and the code has change a bit and its not valid anymore this solution. Some other solution should be rethought. I'm going to clean all kw, to have a more recent version after 8 years.
This ticket was mentioned in PR #10059 on WordPress/wordpress-develop by @levinbaria.
12 months ago
#7
- Keywords has-patch added; needs-patch removed
When rendering the Date column for posts in the list table, this patch changes the behavior
so that:
- For published posts, the column shows the publication date/time (as before).
- For non-published posts (draft, pending, scheduled, etc.), the column shows the post's last modified date/time.
Trac ticket: https://core.trac.wordpress.org/ticket/40860
This ticket was mentioned in PR #12246 on WordPress/wordpress-develop by @micahele.
3 months ago
#8
- Keywords has-unit-tests added
## Summary
Fixes #40860.
The Posts list table Date column labels non-published posts as "Last Modified" but displays the post_date instead of the modified date. For a pending or draft post with a future publication date, this results in a *future* date being shown under a "Last Modified" label — which is incorrect and confusing.
### Reproduction
- Create a new post
- Schedule it for a date in the future
- Set its status to *Pending Review*
- Save, then return to the Posts list
- The Date column shows the future date labeled "Last Modified"
Verified on the local Docker environment:
post_date (future): 2026-06-27 post_modified (now): 2026-06-20 BEFORE: Last Modified 2026/06/27 at 11:00 pm (wrong — future date) AFTER: Last Modified 2026/06/20 at 11:00 pm (correct — actual modified date)
## The fix
In WP_Posts_List_Table::column_date(), for statuses other than publish and future, display the modified date/time (via get_the_modified_time() and get_post_timestamp( $post, 'modified' )) so the date shown matches the "Last Modified" label. Published and scheduled posts continue to show the publication date as before.
## Testing
Adds unit tests to Tests_Admin_wpPostsListTable:
test_column_date_shows_modified_date_for_pending_scheduled_post— asserts the modified date (not the future publication date) is shown for a pending+scheduled post. Fails without the fix, passes with it.test_column_date_uses_publication_date_for_published_and_scheduled(data provider: published, scheduled) — asserts published/scheduled posts still show the publication date and correct label.
npm run test:php -- --filter test_column_date
✔ Column date shows modified date for pending scheduled post ✔ Column date uses publication date for published and scheduled with data set "published post" ✔ Column date uses publication date for published and scheduled with data set "scheduled post" OK (3 tests, 7 assertions)
- PHP lint: clean
- PHPCS: no new errors/warnings on the changed lines
This builds on the approach proposed in the earlier patch on the ticket, adding unit test coverage (the ticket previously had has-test-info but no automated tests).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)

Settings on Post