From 45eb85457f29961657c01c5079519ed7a35102e4 Mon Sep 17 00:00:00 2001 From: Mark Kelnar <749603+markkelnar@users.noreply.github.com> Date: Tue, 15 Aug 2023 11:12:30 -0500 Subject: [PATCH] When publishing draft with error, do not use publish date. Co-authored-by: Jason Bahl --- src/Admin/Editor.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Admin/Editor.php b/src/Admin/Editor.php index 011e128..df6c354 100644 --- a/src/Admin/Editor.php +++ b/src/Admin/Editor.php @@ -72,6 +72,9 @@ public function validate_and_pre_save_cb( $data, $post ) { } else { $data['post_status'] = 'draft'; + + // This prevents the Admin UI from showing that the post has previously been published (because it actually hasn't been) + $data['post_date_gmt'] = '0000-00-00 00:00:00'; } } }