-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Post Date block always show the accurate Last Modified Date #61953
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
base: trunk
Are you sure you want to change the base?
Post Date block always show the accurate Last Modified Date #61953
Conversation
…m displaying if it was not past the publish date.
…t modified date will now do.
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @TimBHowe! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
@Mamaduka I'm afraid not -- I tried to keep the block as consistent as possible with its previous behavior. In practice, while the logic to provide the last modified date was moved to the newly introduced |
What?
Remove the if statement preventing the Post Date block from returning an empty value when the Last Modified Date is used and it matches the Published Date.
Why?
If you add a label before the Post Date block and you are using the Last Modified Date if is the same as the publish date then it doesn't display on the front end despite being shown in the editor on the back end.
This is another alternative solution to the issue mentioned above and the other pull request I made here: #61920
For this issue: #47738
This being subtractive should be simpler to merge and act as a temporary solution until a Bit solution can be created.
#39831
#61920 (comment)
This does cause an issue...
If the publish date is set in the future to schedule the post the Publish Date and Last Modified Date will show the post was last modified prior to being published. While this is true it may not be ideal for UX/UI.
How?
Removed the if statement here: https://github.com/dsas/gutenberg/blob/5b95e96a90aac522c6df73349930144b89b53dfa/packages/block-library/src/post-date/index.php#L38
Testing Instructions
Screenshots or screencast
Example of potential issue:
