Edit-Flow
Edit-Flow copied to clipboard
Remove hack and set post_date_gmt by default
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:
- 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.
- 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
- Check out PR.
- Enable Calendar module.
- Create post from calendar for a future date.
- Open that post, save it, and verify the future date is still set.
- Create a new post (not via the calendar).
- Save the post, and verify the Publish date still says
Immediately.