Edit-Flow icon indicating copy to clipboard operation
Edit-Flow copied to clipboard

Remove hack and set post_date_gmt by default

Open amyevans opened this issue 4 years ago • 0 comments

Description

This PR is a suggested fix for #676.

It sets post_date_gmt always (instead of having it behind the ef_calendar_allow_ajax_to_set_timestamp filter flag) and removes code that is 8 years old and clearly marked as a "hack".

I’m certainly open to other fixes for #676 as I may not understand the full context of why this code was written this way originally.

However, I think this reasonably accomplishes the goals of:

  1. Maintaining the ability to create a post on a specific date from the Edit Flow Calendar view. After opening that post and clicking "Save draft", the set date persists.
  2. Restoring behavior to how WordPress works without the EF Calendar module enabled for creating and saving a new post (post date remains floating).

Steps to Test

  1. Check out PR.
  2. Enable Calendar module.
  3. Create post from calendar for a future date.
  4. Open that post, save it, and verify the future date is still set.
  5. Create a new post (not via the calendar).
  6. Save the post, and verify the Publish date still says Immediately.

amyevans avatar Jul 16 '21 14:07 amyevans