Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r18023 r18370  
    136136        $post_data = &$_POST;
    137137
     138    // Clear out any data in internal vars.
     139    unset( $post_data['filter'] );
     140
    138141    $post_ID = (int) $post_data['post_ID'];
    139142    $post = get_post( $post_ID );
     
    342345        }
    343346
    344         $tax_names = get_object_taxonomies( get_post($post_ID) );
     347        $post = get_post( $post_ID );
     348        $tax_names = get_object_taxonomies( $post );
    345349        foreach ( $tax_names as $tax_name ) {
    346350            $taxonomy_obj = get_taxonomy($tax_name);
     
    363367            unset( $post_data['tax_input']['category'] );
    364368        }
     369
     370        $post_data['post_mime_type'] = $post->post_mime_type;
     371        $post_data['guid'] = $post->guid;
    365372
    366373        $post_data['ID'] = $post_ID;
     
    535542    $_POST['post_mime_type'] = '';
    536543
     544    // Clear out any data in internal vars.
     545    unset( $_POST['filter'] );
     546
    537547    // Check for autosave collisions
    538548    // Does this need to be updated? ~ Mark
     
    552562            return edit_post();
    553563        }
     564    }
     565
     566    // Edit don't write if we have a post id.
     567    if ( isset( $_POST['ID'] ) ) {
     568        $_POST['post_ID'] = $_POST['ID'];
     569        unset ( $_POST['ID'] );
     570    }
     571    if ( isset( $_POST['post_ID'] ) ) {
     572        return edit_post();
    554573    }
    555574
     
    9981017    $q['post_type'] = 'attachment';
    9991018    $post_type = get_post_type_object( 'attachment' );
    1000     $states = array( 'inherit' );
     1019    $states = 'inherit';
    10011020    if ( current_user_can( $post_type->cap->read_private_posts ) )
    1002         $states[] = 'private';
     1021        $states .= ',private';
    10031022
    10041023    $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states;
Note: See TracChangeset for help on using the changeset viewer.