Opened 7 years ago
Closed 7 years ago
#41336 closed defect (bug) (fixed)
Changeset saved with `publish` status and future date is not scheduled
Reported by: | dlh | Owned by: | westonruter |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Customize | Keywords: | has-patch |
Focuses: | Cc: |
Description
The behavior of WP_Customize_Manager::save_changeset_post()
differs from wp_insert_post()
in how it handles a post date in the future with a post status of publish
.
wp_insert_post()
will keep the date and change the post status to future
: https://github.com/WordPress/WordPress/blob/4.8-branch/wp-includes/post.php#L3161
whereas save_changeset_post()
resets the date and publishes the changeset immediately: https://github.com/WordPress/WordPress/blob/4.8-branch/wp-includes/class-wp-customize-manager.php#L2510
I found this difference unexpected, although I apologize if I've overlooked discussions about it.
The attached patches propose different updates to save_changeset_post()
that would try to reduce the discrepancy. One patch would switch the changeset status from publish
to future
when the changeset date is in the future, in the style of wp_insert_post()
. The other would return a WP_Error
to at least prevent the changeset from being published immediately.
This makes sense to me.