- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/wp-admin/includes/media.php
r18018 r18366 229 229 ), $post_data ); 230 230 231 // This should never be set as it would then overwrite an existing attachment. 232 if ( isset( $attachment['ID'] ) ) 233 unset( $attachment['ID'] ); 234 231 235 // Save the data 232 236 $id = wp_insert_attachment($attachment, $file, $post_id); … … 281 285 'post_content' => $content, 282 286 ), $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'] ); 283 291 284 292 // Save the attachment metadata … … 420 428 if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { 421 429 $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 422 435 if ( isset($attachment['post_content']) ) 423 436 $post['post_content'] = $attachment['post_content'];
Note: See TracChangeset
for help on using the changeset viewer.