Skip to content

Commit 8825df7

Browse files
committed
Fix test problem that was causing WordPress to generate JPEG despite WebP support (by secondary editor class).
1 parent 166f5b4 commit 8825df7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/modules/images/webp-uploads/load-tests.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,9 @@ public function it_should_allow_the_upload_of_a_webp_image_if_at_least_one_edito
586586
add_filter(
587587
'wp_image_editors',
588588
function () {
589-
return array( 'WP_Image_Doesnt_Support_WebP', 'WP_Image_Editor_GD' );
589+
// WP core does not choose the WP_Image_Editor instance based on MIME type support,
590+
// therefore the one that does support WebP needs to be first in this list.
591+
return array( 'WP_Image_Editor_GD', 'WP_Image_Doesnt_Support_WebP' );
590592
}
591593
);
592594

0 commit comments

Comments
 (0)