]+wp-block-cover__inner-container[\s|"][^>]*>/U';
if ( 1 === preg_match( $inner_container_start, $content, $matches, PREG_OFFSET_CAPTURE ) {
list( $fullmatch, $offset ) = $matches[0];
$content = substr( $content, 0, $offset ) . $image_tag . substr( $content, $offset );
From e374216724d613e5a5f140821bb8d6c842261d61 Mon Sep 17 00:00:00 2001
From: navigatrum <6989338+navigatrum@users.noreply.github.com>
Date: Fri, 24 Jun 2022 20:39:00 +0200
Subject: [PATCH 6/9] close bracket ad reformat comment
---
packages/block-library/src/cover/index.php | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/packages/block-library/src/cover/index.php b/packages/block-library/src/cover/index.php
index 57000a5dfff0f8..a9dc1ff9262db1 100644
--- a/packages/block-library/src/cover/index.php
+++ b/packages/block-library/src/cover/index.php
@@ -60,10 +60,12 @@ class="wp-block-cover__image-background"
esc_attr( $object_position )
);
- /* Inserts the featured image between the (1st) cover 'background' `span` and 'inner_container' `div`,
- and removes eventual withespace characters between the two (typically introduced at template level) */
+ /*
+ * Inserts the featured image between the (1st) cover 'background' `span` and 'inner_container' `div`,
+ * and removes eventual withespace characters between the two (typically introduced at template level)
+ */
$inner_container_start = '/
]+wp-block-cover__inner-container[\s|"][^>]*>/U';
- if ( 1 === preg_match( $inner_container_start, $content, $matches, PREG_OFFSET_CAPTURE ) {
+ if ( 1 === preg_match( $inner_container_start, $content, $matches, PREG_OFFSET_CAPTURE ) ) {
list( $fullmatch, $offset ) = $matches[0];
$content = substr( $content, 0, $offset ) . $image_tag . substr( $content, $offset );
}
From 7d65028276cd11eb6a3ba95cce12bb15b0539652 Mon Sep 17 00:00:00 2001
From: navigatrum <6989338+navigatrum@users.noreply.github.com>
Date: Sat, 25 Jun 2022 03:45:24 +0200
Subject: [PATCH 7/9] retry to fix
---
packages/block-library/src/cover/index.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/block-library/src/cover/index.php b/packages/block-library/src/cover/index.php
index a9dc1ff9262db1..d234c0c82b661f 100644
--- a/packages/block-library/src/cover/index.php
+++ b/packages/block-library/src/cover/index.php
@@ -66,8 +66,8 @@ class="wp-block-cover__image-background"
*/
$inner_container_start = '/
]+wp-block-cover__inner-container[\s|"][^>]*>/U';
if ( 1 === preg_match( $inner_container_start, $content, $matches, PREG_OFFSET_CAPTURE ) ) {
- list( $fullmatch, $offset ) = $matches[0];
- $content = substr( $content, 0, $offset ) . $image_tag . substr( $content, $offset );
+ $offset = $matches[0][1];
+ $content = substr( $content, 0, $offset ) . $image . substr( $content, $offset );
}
}
From 98424c753fbec2bc51f6d560fd731d586c84ea1d Mon Sep 17 00:00:00 2001
From: Adam Zielinski
Date: Mon, 27 Jun 2022 13:01:01 +0200
Subject: [PATCH 8/9] Update packages/block-library/src/cover/index.php
---
packages/block-library/src/cover/index.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/packages/block-library/src/cover/index.php b/packages/block-library/src/cover/index.php
index d234c0c82b661f..aae656376384c3 100644
--- a/packages/block-library/src/cover/index.php
+++ b/packages/block-library/src/cover/index.php
@@ -69,7 +69,6 @@ class="wp-block-cover__image-background"
$offset = $matches[0][1];
$content = substr( $content, 0, $offset ) . $image . substr( $content, $offset );
}
-
}
return $content;
From 7cd71a269ab219b605436650d1e4a274da0b99c5 Mon Sep 17 00:00:00 2001
From: Adam Zielinski
Date: Mon, 27 Jun 2022 13:01:07 +0200
Subject: [PATCH 9/9] Update packages/block-library/src/cover/index.php
---
packages/block-library/src/cover/index.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/block-library/src/cover/index.php b/packages/block-library/src/cover/index.php
index aae656376384c3..e2c23b9c99421d 100644
--- a/packages/block-library/src/cover/index.php
+++ b/packages/block-library/src/cover/index.php
@@ -66,7 +66,7 @@ class="wp-block-cover__image-background"
*/
$inner_container_start = '/]+wp-block-cover__inner-container[\s|"][^>]*>/U';
if ( 1 === preg_match( $inner_container_start, $content, $matches, PREG_OFFSET_CAPTURE ) ) {
- $offset = $matches[0][1];
+ $offset = $matches[0][1];
$content = substr( $content, 0, $offset ) . $image . substr( $content, $offset );
}
}