Changeset 56193 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
- Timestamp:
- 07/10/2023 10:58:33 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r56168 r56193 203 203 204 204 if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { 205 // Set a custom header with the attachment_id. 206 // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 205 /* 206 * Set a custom header with the attachment_id. 207 * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 208 */ 207 209 header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id ); 208 210 } … … 212 214 require_once ABSPATH . 'wp-admin/includes/image.php'; 213 215 214 // Post-process the upload (create image sub-sizes, make PDF thumbnails, etc.) and insert attachment meta. 215 // At this point the server may run out of resources and post-processing of uploaded images may fail. 216 /* 217 * Post-process the upload (create image sub-sizes, make PDF thumbnails, etc.) and insert attachment meta. 218 * At this point the server may run out of resources and post-processing of uploaded images may fail. 219 */ 216 220 wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) ); 217 221 … … 563 567 $image_name = wp_basename( $image_file, ".{$image_ext}" ); 564 568 565 // Do not append multiple `-edited` to the file name. 566 // The user may be editing a previously edited image. 569 /* 570 * Do not append multiple `-edited` to the file name. 571 * The user may be editing a previously edited image. 572 */ 567 573 if ( preg_match( '/-edited(-\d+)?$/', $image_name ) ) { 568 574 // Remove any `-1`, `-2`, etc. `wp_unique_filename()` will add the proper number. … … 626 632 627 633 if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { 628 // Set a custom header with the attachment_id. 629 // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 634 /* 635 * Set a custom header with the attachment_id. 636 * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 637 */ 630 638 header( 'X-WP-Upload-Attachment-ID: ' . $new_attachment_id ); 631 639 }
Note: See TracChangeset
for help on using the changeset viewer.