Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #38943


Ignore:
Timestamp:
11/26/2016 04:28:53 AM (9 years ago)
Author:
westonruter
Comment:

@utkarshpatel Is this fully a bug? Core actually allows you to create future-dated draft posts. It seems the one bug here is that after a changeset has been given a future date and a future status, that currently it is not facilitating the removal of the future status and future-date from the changeset, right?

Since published changesets should serve as a timeline of published customizer changes, it would make sense to continue to disallow the supplying of the date for any supplied date that is not in the future. So I think that future dates should still be allowed when saving a changeset as a draft and not just future.

So the question then is what to do about the case where a user wants to un-schedule a future changeset, not just remove the future status. If they change their mind and want to publish a changeset that they formerly had scheduled, then they need to change the status to publish and reset the date to the current time. There's actually a convention in core for resetting the time to present and that is 0000-00-00 00:00:00.

If a changeset post is saved as a draft, and its date is not currently in the future, then its date should be reset to the current time, that is to 0000-00-00 00:00:00, so that when it does get published it will have the current timestamp as its published time so that the changesets have the proper chronological order of publishing.

I'm milestoning this for 4.7 even though we're in RC. Normally users never encounter this issue since core doesn't yet provide a UI for drafting and scheduling changesets. It would specifically be a problem in the Customize Snapshots feature plugin, and even then a workaround could be put in place via wp_insert_post_data filter.

So what do you think? Do you agree with my suggestions? Do you want to write the patch?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #38943

    • Property Keywords needs-patch added
    • Property Milestone changed from Awaiting Review to 4.7
  • Ticket #38943 – Description

    initial v1  
    11In changeset when we update status with `future` with date
    2 {{{#!php
     2{{{#!js
    33wp.customize.previewer.save({status: 'future', date: '2017-01-01 00:00:00'})
    44}}}
    55
    66And after that if we change status to `draft`
    7 {{{#!php
     7{{{#!js
    88wp.customize.previewer.save({status: 'draft', title: 'Add 2017 greeting'})
    99}}}
     
    1212
    1313If we send `draft` request with `date` param
    14 {{{#!php
     14{{{#!js
    1515wp.customize.previewer.save({status: 'draft', title: 'Add 2017 greeting', date: '2016-11-26 01:02:00'})
    1616}}}