WordPress.org

Make WordPress Core

Changeset 8636


Ignore:
Timestamp:
08/13/2008 04:01:01 PM (13 years ago)
Author:
ryan
Message:

Make sure timestamps are not 0000 when publishing. Props techcookies. fixes #6527

File:
1 edited

Legend:

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

    r8635 r8636  
    13551355
    13561356    // If the post date is empty (due to having been new or a draft) and status is not 'draft', set date to now
    1357     if (empty($post_date)) {
     1357    if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) {
    13581358        if ( !in_array($post_status, array('draft', 'pending')) )
    13591359            $post_date = current_time('mysql');
     
    13621362    }
    13631363
    1364     if (empty($post_date_gmt)) {
     1364    if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) {
    13651365        if ( !in_array($post_status, array('draft', 'pending')) )
    13661366            $post_date_gmt = get_gmt_from_date($post_date);
Note: See TracChangeset for help on using the changeset viewer.