Skip to content

Commit

Permalink
When publishing draft with error, do not use publish date.
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Bahl <[email protected]>
  • Loading branch information
markkelnar and jasonbahl authored Aug 15, 2023
1 parent 655fcae commit 45eb854
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Admin/Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
}
Expand Down

0 comments on commit 45eb854

Please sign in to comment.