-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataViews: display published date for pages/posts with published status #64049
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +6 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
0bb02f5
to
3d4f586
Compare
getFormattedDate( dateToDisplay ) | ||
/* translators: %s: page creation time */ | ||
__( '<span>Published: <time>%s</time></span>' ), | ||
getFormattedDate( item.date ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the core change (dateToDisplay
becomes item.date
). The rest is due to moving isPublished
logic before isPending
.
As of this PR, all statuses but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
cc @jameskoster
Follow-up to #61709
What?
Display the published date for posts/pages with published status. Before it displayed the newest of modified and published date.
Why?
This is how other parts of the system work (wp-admin post/page list, post/page inspector). It's also how the REST API works, and by not using published date the sort results are visually incoherent with sorting.
In the example below, after installing the theme test data, I edited the "WP 6.1 font size scale" post. In wp-admin and dataviews sorted the list by date descending. This is how it looked everywhere:
How?
Updates the
render
function of thedate
field to use theitem.date
instead ofitem.modified
for published posts/pages.Testing Instructions
The expected result is that "Post 2" is above "Post 1".
The expected result is that "Post 2" is still above "Post 1".