Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/wp-includes/post.php

    r8261 r8640  
    511511function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) {
    512512        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;
    513517
    514518        // expected_slashed ($meta_key)
    … …  
    12731277
    12741278        // 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 ) {
    12761280                if ( !in_array($post_status, array('draft', 'pending')) )
    12771281                        $post_date = current_time('mysql');
    … …  
    12801284        }
    12811285
    1282         if (empty($post_date_gmt)) {
     1286        if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) {
    12831287                if ( !in_array($post_status, array('draft', 'pending')) )
    12841288                        $post_date_gmt = get_gmt_from_date($post_date);
    … …  
    31143118                $fields = array(
    31153119                        'post_title' => __( 'Title' ),
    3116                         'post_author' => __( 'Author' ),
    31173120                        'post_content' => __( 'Content' ),
    31183121                        'post_excerpt' => __( 'Excerpt' ),
    … …  
    31233126
    31243127                // 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 )
    31263129                        unset( $fields[$protect] );
    31273130        }
Note: See TracChangeset for help on using the changeset viewer.