From ff94866fe611d8170a2df26b856c0b5744fa28b5 Mon Sep 17 00:00:00 2001 From: desrosj Date: Mon, 21 Dec 2020 18:51:04 +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. Merges [49860] to the 5.6 branch. Fixes #52139. Built from https://develop.svn.wordpress.org/branches/5.6@49861 git-svn-id: http://core.svn.wordpress.org/branches/5.6@49580 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 23aca707ff..d42ea16eb4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6.1-alpha-49855'; +$wp_version = '5.6.1-alpha-49861'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.