Ticket #15946: 15946.diff
File 15946.diff, 1.2 KB (added by , 14 years ago) |
---|
-
post.php
2458 2458 $post_name = sanitize_title($post_name); 2459 2459 } 2460 2460 2461 // If the post date is empty (due to having been new or a draft) and status is not 'draft' or 'pending', set date to now 2462 if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) 2463 $post_date = current_time('mysql'); 2461 // If the post date is empty, set date to now or from GMT if available 2462 if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) { 2463 if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) 2464 $post_date = current_time('mysql'); 2465 else 2466 $post_date = get_date_from_gmt($post_date_gmt); 2467 } 2464 2468 2465 2469 if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) { 2466 2470 if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) … … 2469 2473 $post_date_gmt = '0000-00-00 00:00:00'; 2470 2474 } 2471 2475 2472 if ( $update || '0000-00-00 00:00:00' == $post_date) {2476 if ( $update ) { 2473 2477 $post_modified = current_time( 'mysql' ); 2474 2478 $post_modified_gmt = current_time( 'mysql', 1 ); 2475 2479 } else {