Skip to content
Snippets Groups Projects
Commit 0c403fa5 authored by Lionel Enkaoua's avatar Lionel Enkaoua
Browse files

Merge branch '3461863-fix-sources-order' into 'main'

Order source images accordng media queries

See merge request !50
parents 6be7fb7e 11dcf491
No related branches found
No related tags found
No related merge requests found
Pipeline #451974 skipped
......@@ -105,14 +105,9 @@ function imageapi_optimize_avif_webp_responsive_preprocess_responsive_image(&$va
}
// If any AVIF or WebP sources are created, merge them with existing sources.
foreach ([$webp_sources, $avif_sources] as $sources) {
if (!empty($sources)) {
foreach ($sources as $source) {
array_unshift($variables['sources'], $source);
}
$variables['output_image_tag'] = FALSE;
}
}
array_unshift($variables['sources'], ...$webp_sources);
array_unshift($variables['sources'], ...$avif_sources);
$variables['output_image_tag'] = FALSE;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment