Ticket #5698: 5698.diff
File 5698.diff, 1.5 KB (added by , 16 years ago) |
---|
-
wp-includes/post.php
1360 1360 } 1361 1361 1362 1362 // If the post date is empty (due to having been new or a draft) and status is not 'draft', set date to now 1363 if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) { 1364 if ( !in_array($post_status, array('draft', 'pending')) ) 1365 $post_date = current_time('mysql'); 1366 else 1367 $post_date = '0000-00-00 00:00:00'; 1368 } 1363 if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) 1364 $post_date = current_time('mysql'); 1369 1365 1370 1366 if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) { 1371 1367 if ( !in_array($post_status, array('draft', 'pending')) ) … … 1534 1530 $post_cats = $post['post_category']; 1535 1531 1536 1532 // Drafts shouldn't be assigned a date unless explicitly done so by the user 1537 if ( in_array($post['post_status'], array('draft', 'pending')) && empty($postarr['edit_date']) && empty($postarr['post_date']) &&1538 ('0000-00-00 00:00:00' == $post['post_date ']) )1533 if ( in_array($post['post_status'], array('draft', 'pending')) && empty($postarr['edit_date']) && 1534 ('0000-00-00 00:00:00' == $post['post_date_gmt']) ) 1539 1535 $clear_date = true; 1540 1536 else 1541 1537 $clear_date = false; … … 1544 1540 $postarr = array_merge($post, $postarr); 1545 1541 $postarr['post_category'] = $post_cats; 1546 1542 if ( $clear_date ) { 1547 $postarr['post_date'] = '';1543 $postarr['post_date'] = current_time('mysql');; 1548 1544 $postarr['post_date_gmt'] = ''; 1549 1545 } 1550 1546