Changeset 8920
- Timestamp:
- 09/17/2008 08:19:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r8918 r8920 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 ) { … … 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 … … 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 }
Note: See TracChangeset
for help on using the changeset viewer.