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 | } |