Skip to content

Commit c6baf72

Browse files
Ensure default image sizes output mimes
1 parent 4f9b605 commit c6baf72

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/wp-includes/media.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -918,11 +918,15 @@ function wp_get_registered_image_subsizes() {
918918
$all_sizes = array();
919919

920920
foreach ( get_intermediate_image_sizes() as $size_name ) {
921-
$size_data = array(
922-
'width' => 0,
923-
'height' => 0,
924-
'crop' => false,
925-
);
921+
$default_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' );
922+
foreach ( get_intermediate_image_sizes() as $size_name ) {
923+
$size_data = array(
924+
'width' => 0,
925+
'height' => 0,
926+
'crop' => false,
927+
'output_mimes' => in_array( $size_name, $default_sizes, true ),
928+
);
929+
}
926930

927931
if ( isset( $additional_sizes[ $size_name ]['width'] ) ) {
928932
// For sizes added by plugins and themes.

0 commit comments

Comments
 (0)