Changeset 46382 for trunk/src/wp-admin/includes/media.php
- Timestamp:
- 10/03/2019 09:00:10 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/media.php
r46359 r46382 315 315 $content = ''; 316 316 $excerpt = ''; 317 $_ref = false;318 317 319 318 if ( preg_match( '#^audio#', $type ) ) { … … 410 409 411 410 if ( ! is_wp_error( $attachment_id ) ) { 412 // If an image, keep the upload reference until all image sub-sizes are created.413 if ( ! empty( $_POST['_wp_temp_upload_ref'] ) && wp_attachment_is_image( $attachment_id ) ) {414 $_ref = _wp_set_upload_ref( $_POST['_wp_temp_upload_ref'], $attachment_id );415 }416 417 411 // The image sub-sizes are created during wp_generate_attachment_metadata(). 418 412 // This is generally slow and may cause timeouts or out of memory errors. 419 413 wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) ); 420 421 // At this point the image is uploaded successfully even if there were specific errors or some sub-sizes were not created.422 // The transient is not needed any more.423 if ( $_ref ) {424 _wp_clear_upload_ref( $_POST['_wp_temp_upload_ref'] );425 }426 414 } 427 415
Note: See TracChangeset
for help on using the changeset viewer.