WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #39953, comment 14


Ignore:
Timestamp:
08/03/2018 02:55:40 PM (12 months ago)
Author:
earnjam
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #39953, comment 14

    initial v1  
    11After thinking on it a bit more, I'm closer to agreeing with @jnylen0 here.
    22
    3 I'm not crazy about adding a separate flag for this, but the dates shouldn't have been used in this way from the beginning. In my opinion there should have been no dates stored for either `post_date` or `post_date_gmt` until published or manually set and `post_modified` and `post_modified_gmt` should have been used instead. You could even argue that from the beginning the REST API should have returned null values for both `date` **''and''** `date_gmt` if there was no `post_date_gmt` stored, since it would mean there wasn't a **''true''** date set for the post yet. The shim wasn't really needed IMO because you should have been using the `modified_gmt` value when you needed a date for an unpublished/unscheduled draft. But here we are.
     3I'm not crazy about adding a separate flag for this, but the dates shouldn't have been used in this way from the beginning. In my opinion there should have been no dates stored for either `post_date` or `post_date_gmt` until published or manually set, and `post_modified` and `post_modified_gmt` should have been used instead. You could even argue that from the beginning the REST API should have returned null values for both `date` **''and''** `date_gmt` if there was no `post_date_gmt` stored, since it would mean there wasn't a **''true''** date set for the post yet. The shim wasn't really needed IMO because you should have been using the `modified_gmt` value when you needed a date for an unpublished/unscheduled draft. But here we are.
    44
    55At this point, changing the way we supply `date_gmt` in the REST API now does add potential for breakage even with the `edit` context, as there might be clients using `edit` context now and not expecting a null value there.