summaryrefslogtreecommitdiffstats
path: root/wp-includes/post.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/post.php')
-rw-r--r--wp-includes/post.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/wp-includes/post.php b/wp-includes/post.php
index a4a0b5e..bf7d922 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -1276,14 +1276,14 @@ function wp_insert_post($postarr = array(), $wp_error = false) {
}
// If the post date is empty (due to having been new or a draft) and status is not 'draft', set date to now
- if (empty($post_date)) {
+ if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) {
if ( !in_array($post_status, array('draft', 'pending')) )
$post_date = current_time('mysql');
else
$post_date = '0000-00-00 00:00:00';
}
- if (empty($post_date_gmt)) {
+ if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) {
if ( !in_array($post_status, array('draft', 'pending')) )
$post_date_gmt = get_gmt_from_date($post_date);
else