From d4cf6827161a88118e5f970426527136cf1ca533 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Mon, 18 Sep 2023 17:36:51 +0000 Subject: [PATCH] Bundled Theme: Add missing dimension attributes to images in Twenty Twenty-Two patterns. The dimension attributes `width` and `height` should be present on every image in order to avoid layout shifts and be able to leverage WordPress core's image loading optimization functionality. This changeset adds dimension attributes to the `core/image` blocks used in block patterns in Twenty Twenty-Two, where this is particularly critical as WordPress core cannot backfill the attributes for those images, as their sources are not part of the Media Library. Props spacedmonkey, thekt12, mukesh27, flixos90. Fixes #59256. git-svn-id: https://develop.svn.wordpress.org/trunk@56613 602fd350-edb4-49c9-b593-d223f7449a82 --- .../twentytwentytwo/inc/patterns/general-divider-dark.php | 4 ++-- .../inc/patterns/general-divider-light.php | 4 ++-- .../inc/patterns/general-two-images-text.php | 8 ++++---- .../inc/patterns/general-wide-image-intro-buttons.php | 4 ++-- .../twentytwentytwo/inc/patterns/header-large-dark.php | 4 ++-- .../twentytwentytwo/inc/patterns/header-small-dark.php | 4 ++-- .../themes/twentytwentytwo/inc/patterns/hidden-bird.php | 4 ++-- .../inc/patterns/hidden-heading-and-bird.php | 4 ++-- .../inc/patterns/page-about-large-image-and-buttons.php | 4 ++-- .../inc/patterns/page-layout-image-and-text.php | 4 ++-- .../inc/patterns/page-layout-image-text-and-video.php | 4 ++-- .../inc/patterns/page-sidebar-blog-posts-right.php | 4 ++-- .../twentytwentytwo/inc/patterns/page-sidebar-poster.php | 4 ++-- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/general-divider-dark.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/general-divider-dark.php index e13422c865..3255e9d706 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/general-divider-dark.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/general-divider-dark.php @@ -6,8 +6,8 @@ return array( 'title' => __( 'Divider with image and color (dark)', 'twentytwentytwo' ), 'categories' => array( 'featured' ), 'content' => ' -
-
+
+
', ); diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/general-divider-light.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/general-divider-light.php index 5df910ea8e..a29b8252d7 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/general-divider-light.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/general-divider-light.php @@ -6,8 +6,8 @@ return array( 'title' => __( 'Divider with image and color (light)', 'twentytwentytwo' ), 'categories' => array( 'featured' ), 'content' => ' -
-
+
+
', ); diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/general-two-images-text.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/general-two-images-text.php index 593d2b93bb..5534b6ffba 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/general-two-images-text.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/general-two-images-text.php @@ -7,14 +7,14 @@ return array( 'categories' => array( 'featured', 'columns', 'gallery' ), 'content' => '
-
-
' . esc_attr__( 'Illustration of a bird sitting on a branch.', 'twentytwentytwo' ) . '
+
+
' . esc_attr__( 'Illustration of a bird sitting on a branch.', 'twentytwentytwo' ) . '
-
-
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
+
+
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/general-wide-image-intro-buttons.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/general-wide-image-intro-buttons.php index ea9ecf2911..373b0f48bb 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/general-wide-image-intro-buttons.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/general-wide-image-intro-buttons.php @@ -6,8 +6,8 @@ return array( 'title' => __( 'Wide image with introduction and buttons', 'twentytwentytwo' ), 'categories' => array( 'featured', 'columns' ), 'content' => ' -
-
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
+
+
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/header-large-dark.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/header-large-dark.php index dfb8c6f371..5e4fea69ed 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/header-large-dark.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/header-large-dark.php @@ -25,8 +25,8 @@ return array(
- -
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
+ +
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/header-small-dark.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/header-small-dark.php index 7c26516fe6..832f414220 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/header-small-dark.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/header-small-dark.php @@ -21,8 +21,8 @@ return array(
- -
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
+ +
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/hidden-bird.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/hidden-bird.php index c29d3d440a..cfc9db5794 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/hidden-bird.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/hidden-bird.php @@ -8,7 +8,7 @@ return array( 'title' => __( 'Heading and bird image', 'twentytwentytwo' ), 'inserter' => false, - 'content' => ' -
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
+ 'content' => ' +
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
', ); diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/hidden-heading-and-bird.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/hidden-heading-and-bird.php index 28f3d6c5de..d3f1788ac5 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/hidden-heading-and-bird.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/hidden-heading-and-bird.php @@ -15,7 +15,7 @@ return array(
- -
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
+ +
' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '
', ); diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/page-about-large-image-and-buttons.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/page-about-large-image-and-buttons.php index 7e03ed41e2..12d44e793b 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/page-about-large-image-and-buttons.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/page-about-large-image-and-buttons.php @@ -6,8 +6,8 @@ return array( 'title' => __( 'About page with large image and buttons', 'twentytwentytwo' ), 'categories' => array( 'pages', 'buttons' ), 'content' => ' -
-
+
+
diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/page-layout-image-and-text.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/page-layout-image-and-text.php index 7b6fa3ad81..eec6e0d88c 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/page-layout-image-and-text.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/page-layout-image-and-text.php @@ -11,8 +11,8 @@ return array(
- -
' . esc_attr_x( 'TBD', 'Short for to be determined', 'twentytwentytwo' ) . '
+ +
' . esc_attr_x( 'TBD', 'Short for to be determined', 'twentytwentytwo' ) . '
diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/page-layout-image-text-and-video.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/page-layout-image-text-and-video.php index 7a7a6b79d3..bfb4e6e988 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/page-layout-image-text-and-video.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/page-layout-image-text-and-video.php @@ -38,8 +38,8 @@ return array(
- -
' . esc_attr__( 'An illustration of a bird in flight', 'twentytwentytwo' ) . '
+ +
' . esc_attr__( 'An illustration of a bird in flight', 'twentytwentytwo' ) . '
diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/page-sidebar-blog-posts-right.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/page-sidebar-blog-posts-right.php index 84e3b081c6..1601925020 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/page-sidebar-blog-posts-right.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/page-sidebar-blog-posts-right.php @@ -54,8 +54,8 @@ return array( -
-
' . esc_attr__( 'Illustration of a flying bird.', 'twentytwentytwo' ) . '
+
+
' . esc_attr__( 'Illustration of a flying bird.', 'twentytwentytwo' ) . '
diff --git a/src/wp-content/themes/twentytwentytwo/inc/patterns/page-sidebar-poster.php b/src/wp-content/themes/twentytwentytwo/inc/patterns/page-sidebar-poster.php index 62df8059ec..bc744b1b83 100644 --- a/src/wp-content/themes/twentytwentytwo/inc/patterns/page-sidebar-poster.php +++ b/src/wp-content/themes/twentytwentytwo/inc/patterns/page-sidebar-poster.php @@ -22,8 +22,8 @@ return array(
-
-
' . esc_attr__( 'Image of a bird on a branch', 'twentytwentytwo' ) . '
+
+
' . esc_attr__( 'Image of a bird on a branch', 'twentytwentytwo' ) . '