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

Account for "pending" status when evaluating floating post dates #13178

merged 1 commit into from Jan 10, 2019


None yet
4 participants
Copy link

earnjam commented Jan 3, 2019

In #9967 we addressed the issue with post dates properly floating for posts with a status of draft, but we didn't account for posts that are marked for review and thus have a status of pending. This led to #13176.

This simple fix checks for status of pending in addition to draft and auto-draft when evaluating whether a date is floating.

Fixes #13176

@@ -572,7 +572,7 @@ export function isEditedPostDateFloating( state ) {
const date = getEditedPostAttribute( state, 'date' );
const modified = getEditedPostAttribute( state, 'modified' );
const status = getEditedPostAttribute( state, 'status' );
if ( status === 'draft' || status === 'auto-draft' ) {
if ( status === 'draft' || status === 'auto-draft' || status === 'pending' ) {

This comment has been minimized.


jorgefilipecosta Jan 4, 2019


I think the change makes sense! Would it be possible to add a test case covering pending state to the isEditedPostDateFloating selector test suite?

This comment has been minimized.


davisshaver Jan 9, 2019


@jorgefilipecosta Took care of this here #13256

Copy link

jorgefilipecosta left a comment

Given that @davisshaver implemented a test case in a different PR I think this PR can be merged. PR #13256 should be merged right after.
Thank you for your PR's @earnjam and @davisshaver!


This comment has been minimized.

Copy link
Contributor Author

earnjam commented Jan 9, 2019

Thanks @davisshaver!

@earnjam earnjam merged commit 2b41810 into master Jan 10, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

jorgefilipecosta added a commit that referenced this pull request Jan 21, 2019

Add test case for pending to isEditedPostDateFloating suite (#13256) (#…

This is just a follow up for #13256. It was opened against the `fix/13176-post-date-pending` branch instead of `master`. It should have been merged there first prior to #13178 getting merged. 

This just brings that test over to `master`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment