Make WordPress Core


Ignore:
Timestamp:
10/07/2019 03:28:29 PM (5 years ago)
Author:
azaozz
Message:

Upload: Set custom header with the attachment ID for all uploads from media_handle_upload(). Let the REST API endpoint set it separately.

Props timothyblynjacobs.
Fixes #48200.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r46382 r46421  
    24422442    }
    24432443
     2444    // Set a custom header with the attachment_id.
     2445    // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error.
     2446    if ( ! headers_sent() ) {
     2447        header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id );
     2448    }
     2449
    24442450    // This can still be pretty slow and cause timeout or out of memory errors.
    24452451    // The js that handles the response would need to also handle HTTP 500 errors.
Note: See TracChangeset for help on using the changeset viewer.