Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #62729, comment 4


Ignore:
Timestamp:
01/27/2025 11:44:03 AM (5 months ago)
Author:
Hrohh
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #62729, comment 4

    initial v1  
    77function core_thumbnail_generator_image_editor_save_pre( $image, $attachment_id ) {
    88
    9     if ( ! ( did_action( 'wp_ajax_image-editor' ) || did_action( 'wp_ajax_imgedit-preview' ) ) )
    10         return $image;
    11 
    12     $attachment = get_post( $attachment_id );
    13     if ( in_array( $attachment->post_mime_type, array( 'image/jpeg', 'image/png', 'image/apng', 'image/gif', 'image/bmp', 'image/webp', 'image/avif' ) ) )
    14         return $image;
    15 
    16     if ( is_wp_error( $image->stream() ) ) {
    17         return false;
     9    if ( did_action( 'wp_ajax_imgedit-preview' ) ) {
     10        if ( is_wp_error( $image->stream() ) ) {
     11            wp_die( -1 );
     12        } else {
     13            wp_die();
     14        }   
    1815    }
    1916}
    20 }}}
     17