From b8e5751dd110b4965528529f3fd142013ad58b0e Mon Sep 17 00:00:00 2001 From: desrosj Date: Mon, 21 Dec 2020 18:39:03 +0000 Subject: [PATCH] =?UTF-8?q?Twenty=20Twenty-One:=20Do=20not=20specify=20`lo?= =?UTF-8?q?ading=3D=E2=80=9Ceager=E2=80=9D`=20for=20single=20post=20thumbn?= =?UTF-8?q?ails.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While `loading=“eager”` is a supported alternative to omitting the attribute entirely, browsers follow the value of this attribute explicitly when specified. Specifying `eager` would prevent the user from receiving any additional potential benefits implemented at the browser level, such as further mechanisms to automatically decide which elements to lazy-load. Props flixos90, ryelle, poena. Fixes #52139. Built from https://develop.svn.wordpress.org/trunk@49860 git-svn-id: http://core.svn.wordpress.org/trunk@49579 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwentyone/inc/template-tags.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/twentytwentyone/inc/template-tags.php b/wp-content/themes/twentytwentyone/inc/template-tags.php index faa7e495da..38add801c5 100644 --- a/wp-content/themes/twentytwentyone/inc/template-tags.php +++ b/wp-content/themes/twentytwentyone/inc/template-tags.php @@ -190,8 +190,8 @@ if ( ! function_exists( 'twenty_twenty_one_post_thumbnail' ) ) {
'eager' ) ); + // Lazy-loading attributes should be skipped for thumbnails since they are immediately in the viewport. + the_post_thumbnail( 'post-thumbnail', array( 'loading' => false ) ); ?>
diff --git a/wp-includes/version.php b/wp-includes/version.php index e6be5cc7c1..4f4d2bed01 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-alpha-49859'; +$wp_version = '5.7-alpha-49860'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.