Post Date block always show the accurate Last Modified Date #61953
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
