diff --git src/wp-includes/post.php src/wp-includes/post.php
index 6360735..4997766 100644
|
|
function wp_update_post( $postarr = array(), $wp_error = false ) { |
3538 | 3538 | $post_cats = $post['post_category']; |
3539 | 3539 | |
3540 | 3540 | // Drafts shouldn't be assigned a date unless explicitly done so by the user. |
3541 | | if ( isset( $post['post_status'] ) && in_array($post['post_status'], array('draft', 'pending', 'auto-draft')) && empty($postarr['edit_date']) && |
3542 | | ('0000-00-00 00:00:00' == $post['post_date_gmt']) ) |
3543 | | $clear_date = true; |
3544 | | else |
3545 | | $clear_date = false; |
| 3541 | $clear_date = false; |
| 3542 | if ( isset( $post['post_status'] ) && in_array($post['post_status'], array('draft', 'pending', 'auto-draft')) ) { |
| 3543 | // edit_date will only be set for date edits made throug wp-admin, not through XMRLPC API |
| 3544 | $missing_admin_edit_flag = empty( $postarr['edit_date'] ); |
| 3545 | $missing_post_date = ( '0000-00-00 00:00:00' == $post['post_date_gmt'] ); |
| 3546 | $missing_post_date_gmt = ( '0000-00-00 00:00:00' == $post['post_date'] ); |
| 3547 | if ( $missing_admin_edit_flag && $missing_post_date && $missing_post_date_gmt ) { |
| 3548 | $clear_date = true; |
| 3549 | } |
| 3550 | } |
3546 | 3551 | |
3547 | 3552 | // Merge old and new fields with new fields overwriting old ones. |
3548 | 3553 | $postarr = array_merge($post, $postarr); |