Make WordPress Core

Changeset 8920


Ignore:
Timestamp:
09/17/2008 08:19:29 PM (16 years ago)
Author:
ryan
Message:

Set post_date for drafts. see #5698

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r8918 r8920  
    13611361
    13621362    // 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');
    13691365
    13701366    if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) {
     
    15351531
    15361532    // 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']) )
    15391535        $clear_date = true;
    15401536    else
     
    15451541    $postarr['post_category'] = $post_cats;
    15461542    if ( $clear_date ) {
    1547         $postarr['post_date'] = '';
     1543        $postarr['post_date'] = current_time('mysql');;
    15481544        $postarr['post_date_gmt'] = '';
    15491545    }
Note: See TracChangeset for help on using the changeset viewer.