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