fix: prevent auto-publishing corrections when scheduling posts#4006
Merged
Conversation
dkoo
approved these changes
May 29, 2025
|
Hey @rbcorrales, good job getting this PR merged! 🎉 Now, the Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. Thank you! ❤️ |
rbcorrales
added a commit
that referenced
this pull request
May 29, 2025
matticbot
pushed a commit
that referenced
this pull request
May 29, 2025
# [6.7.0-alpha.3](v6.7.0-alpha.2...v6.7.0-alpha.3) (2025-05-29) ### Bug Fixes * prevent auto-publishing corrections when scheduling posts ([#4006](#4006)) ([7531832](7531832))
matticbot
pushed a commit
that referenced
this pull request
Jun 2, 2025
# [6.7.0](v6.6.4...v6.7.0) (2025-06-02) ### Bug Fixes * **404-images:** use JS without modifying content ([#3963](#3963)) ([9f5646b](9f5646b)) * add missing namespace ([#3980](#3980)) ([6d58793](6d58793)) * **emails:** add missing HTML markup in the change-email-cancel template ([#3981](#3981)) ([040ae30](040ae30)) * **ga4:** fire login/registration activities via SSO ([#3965](#3965)) ([8c97515](8c97515)) * hide modal content gate when modal checkout is opened ([#3953](#3953)) ([a503973](a503973)) * **jetpack:** handle the related posts max age option ([#3964](#3964)) ([8aad2b8](8aad2b8)) * make sure fix duplcate fields apply filters ([#3971](#3971)) ([f361a4e](f361a4e)) * namespace Lite Site ([#3975](#3975)) ([e4665ae](e4665ae)) * prevent auto-publishing corrections when scheduling posts ([#4006](#4006)) ([7531832](7531832)) * sync correction status with parent post status ([#3978](#3978)) ([dcd5a12](dcd5a12)) ### Features * add compatibility to network in custom bylines ([#3972](#3972)) ([199a993](199a993)) * add icons repository and remove custom icons ([#3883](#3883)) ([e56d2e0](e56d2e0)) * **analytics:** "My Account" dashboard interactions ([#3949](#3949)) ([22e9590](22e9590)) * **donations:** update notice style and type ([#3962](#3962)) ([3f60ef3](3f60ef3)) * **email-change:** remove env constant requirement ([#3943](#3943)) ([4158bf1](4158bf1)) * **my-account:** apply Newspack UI styles to My Account w/ env constant ([#3951](#3951)) ([e4aa5a2](e4aa5a2)) * **my-account:** full-site takeover template and custom nav menu ([#3974](#3974)) ([5cf8403](5cf8403)) * **woocommerce:** log error notices ([#3952](#3952)) ([1654007](1654007))
matticbot
pushed a commit
that referenced
this pull request
Jun 5, 2025
# [6.8.0-alpha.1](v6.7.0...v6.8.0-alpha.1) (2025-06-05) ### Bug Fixes * **campaigns:** segments: min/max values for articles read count defaults ([2efe437](2efe437)) * prevent auto-publishing corrections when scheduling posts ([#4006](#4006)) ([1a3dc5b](1a3dc5b)) * sync membership status to ESP when reader deletes account ([#4004](#4004)) ([2cff33b](2cff33b)) * update path to verify template in WooCommerce My Account class ([#3992](#3992)) ([d54e67f](d54e67f)) ### Features * **collections:** add optional collections module ([#3990](#3990)) ([48b4a45](48b4a45)) * **my-account:** custom confirmation modal flows ([#3985](#3985)) ([90990aa](90990aa)) * **my-account:** resubscribe and renew early via modal checkout ([#3973](#3973)) ([5a664a1](5a664a1))
Contributor
|
🎉 This PR is included in version 6.8.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
matticbot
pushed a commit
that referenced
this pull request
Jun 16, 2025
# [6.8.0](v6.7.0...v6.8.0) (2025-06-16) ### Bug Fixes * **campaigns:** segments: min/max values for articles read count defaults ([2efe437](2efe437)) * prevent auto-publishing corrections when scheduling posts ([#4006](#4006)) ([1a3dc5b](1a3dc5b)) * sync membership status to ESP when reader deletes account ([#4004](#4004)) ([2cff33b](2cff33b)) * update path to verify template in WooCommerce My Account class ([#3992](#3992)) ([d54e67f](d54e67f)) * update text in accessibility statement ([#4030](#4030)) ([391d12b](391d12b)) ### Features * add an option to create an Accessibility Statement page ([#4022](#4022)) ([b802442](b802442)) * **collections:** add optional collections module ([#3990](#3990)) ([48b4a45](48b4a45)) * **my-account:** custom confirmation modal flows ([#3985](#3985)) ([90990aa](90990aa)) * **my-account:** resubscribe and renew early via modal checkout ([#3973](#3973)) ([5a664a1](5a664a1))
Contributor
|
🎉 This PR is included in version 6.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
All Submissions:
Changes proposed in this Pull Request:
Prevent corrections from being auto-published when the parent post is scheduled due to this core logic:
https://github.com/WordPress/wordpress-develop/blob/6.8.1/src/wp-includes/post.php#L4638-L4642
The code will now attempt to set the correction status to
privateinstead offutureif the parent post is being scheduled to avoid WordPress immediately publishing the correction if its date is in the past.The other possible approach could be updating the post date of the correction to match its parent future date, but the current approach helps preserve the original correction date across status updates.
How to test the changes in this Pull Request:
privatestatus, notfuture.test_corrections_set_to_private_when_post_scheduledpasses.Other information: