Posts: Display Scheduled state for future-dated private posts#9389
Posts: Display Scheduled state for future-dated private posts#9389himanshupathak95 wants to merge 4 commits intoWordPress:trunkfrom
Scheduled state for future-dated private posts#9389Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
…uture-dated private post states
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Trac ticket: https://core.trac.wordpress.org/ticket/18264
This PR fixes a UI inconsistency where private posts scheduled for a future date do not display the "Scheduled" state in the
All Postslist table. Public and password-protected posts correctly show this state, and this change brings the behavior for private posts into alignment.The fix adds a condition to the
get_post_states()function. It checks if a post with a 'private' status has apost_date_gmtset in the future and, if so, appends the "Scheduled" state to be displayed.How to test:
This change also introduces new unit tests to ensure correctness and prevent future regressions. The tests confirm that a future-dated private post correctly receives both "Private" and "Scheduled" states.
Run the tests -