Twenty Seventeen: Resolves Header Image Quality Issue

The heading image had quality issues on iOS Safari in portrait and landscape modes. This resolves it through adding 200cv for smaller screens so less than full size.

Props poena, richardevs, laurelfulford, davidakennedy, joemcgill, SergeyBiryukov, ianbelanger, sabernhardt, shailu25, robertghetau.
Fixes #39253.

Built from https://develop.svn.wordpress.org/trunk@58135


git-svn-id: http://core.svn.wordpress.org/trunk@57600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Tammie Lister 2024-05-12 09:29:09 +00:00
parent 048c5ba580
commit f38ec10f21
2 changed files with 3 additions and 2 deletions

View File

@ -580,6 +580,7 @@ add_filter( 'wp_calculate_image_sizes', 'twentyseventeen_content_image_sizes_att
* Filters the `sizes` value in the header image markup. * Filters the `sizes` value in the header image markup.
* *
* @since Twenty Seventeen 1.0 * @since Twenty Seventeen 1.0
* @since Twenty Seventeen 3.7 Added larger image size for small screens.
* *
* @param string $html The HTML image tag markup being filtered. * @param string $html The HTML image tag markup being filtered.
* @param object $header The custom header object returned by 'get_custom_header()'. * @param object $header The custom header object returned by 'get_custom_header()'.
@ -588,7 +589,7 @@ add_filter( 'wp_calculate_image_sizes', 'twentyseventeen_content_image_sizes_att
*/ */
function twentyseventeen_header_image_tag( $html, $header, $attr ) { function twentyseventeen_header_image_tag( $html, $header, $attr ) {
if ( isset( $attr['sizes'] ) ) { if ( isset( $attr['sizes'] ) ) {
$html = str_replace( $attr['sizes'], '100vw', $html ); $html = str_replace( $attr['sizes'], '(max-width: 767px) 200vw, 100vw', $html );
} }
return $html; return $html;
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.6-alpha-58134'; $wp_version = '6.6-alpha-58135';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.