Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r18366 r18018  
    229229    ), $post_data );
    230230
    231     // This should never be set as it would then overwrite an existing attachment.
    232     if ( isset( $attachment['ID'] ) )
    233         unset( $attachment['ID'] );
    234 
    235231    // Save the data
    236232    $id = wp_insert_attachment($attachment, $file, $post_id);
     
    285281        'post_content' => $content,
    286282    ), $post_data );
    287 
    288     // This should never be set as it would then overwrite an existing attachment.
    289     if ( isset( $attachment['ID'] ) )
    290         unset( $attachment['ID'] );
    291283
    292284    // Save the attachment metadata
     
    428420    if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) {
    429421        $post = $_post = get_post($attachment_id, ARRAY_A);
    430         $post_type_object = get_post_type_object( $post[ 'post_type' ] );
    431 
    432         if ( !current_user_can( $post_type_object->cap->edit_post, $attachment_id ) )
    433             continue;
    434 
    435422        if ( isset($attachment['post_content']) )
    436423            $post['post_content'] = $attachment['post_content'];
Note: See TracChangeset for help on using the changeset viewer.