Changes from trunk/wp-includes/post.php at r8261 to branches/2.6/wp-includes/post.php at r8640
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/wp-includes/post.php
r8261 r8640 511 511 function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) { 512 512 global $wpdb; 513 514 // make sure meta is added to the post, not a revision 515 if ( $the_post = wp_is_post_revision($post_id) ) 516 $post_id = $the_post; 513 517 514 518 // expected_slashed ($meta_key) … … 1273 1277 1274 1278 // If the post date is empty (due to having been new or a draft) and status is not 'draft', set date to now 1275 if ( empty($post_date)) {1279 if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) { 1276 1280 if ( !in_array($post_status, array('draft', 'pending')) ) 1277 1281 $post_date = current_time('mysql'); … … 1280 1284 } 1281 1285 1282 if ( empty($post_date_gmt)) {1286 if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) { 1283 1287 if ( !in_array($post_status, array('draft', 'pending')) ) 1284 1288 $post_date_gmt = get_gmt_from_date($post_date); … … 3114 3118 $fields = array( 3115 3119 'post_title' => __( 'Title' ), 3116 'post_author' => __( 'Author' ),3117 3120 'post_content' => __( 'Content' ), 3118 3121 'post_excerpt' => __( 'Excerpt' ), … … 3123 3126 3124 3127 // WP uses these internally either in versioning or elsewhere - they cannot be versioned 3125 foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count' ) as $protect )3128 foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect ) 3126 3129 unset( $fields[$protect] ); 3127 3130 }
Note: See TracChangeset
for help on using the changeset viewer.