From 31c7a4283780f415070fe32e713b528da7cef636 Mon Sep 17 00:00:00 2001
From: Ella <4710635+ellatrix@users.noreply.github.com>
Date: Wed, 4 Feb 2026 14:34:32 +0100
Subject: [PATCH 1/7] Update Gutenberg ref in package.json
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9ff5ddd3dae97..66c8e0b5b23af 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"url": "https://develop.svn.wordpress.org/trunk"
},
"gutenberg": {
- "ref": "7bf80ea84eb8b62eceb1bb3fe82e42163673ca79"
+ "ref": "59a08c5496008ca88f4b6b86f38838c3612d88c8"
},
"engines": {
"node": ">=20.10.0",
From dbefe34e115b8d8cd1e4d0044da005bc4e44d41a Mon Sep 17 00:00:00 2001
From: ella
Date: Mon, 9 Feb 2026 10:51:06 +0100
Subject: [PATCH 2/7] Recursively add non-index.php PHP files
---
tools/gutenberg/copy-gutenberg-build.js | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/tools/gutenberg/copy-gutenberg-build.js b/tools/gutenberg/copy-gutenberg-build.js
index f123d3776617a..0280d2112a645 100644
--- a/tools/gutenberg/copy-gutenberg-build.js
+++ b/tools/gutenberg/copy-gutenberg-build.js
@@ -259,6 +259,22 @@ function copyBlockAssets( config ) {
const content = fs.readFileSync( blockPhpSrc, 'utf8' );
fs.writeFileSync( phpDest, content );
}
+
+ // 4. Copy PHP subdirectories from packages (e.g., shared/helpers.php)
+ const blockPhpDir = path.join( phpSrc, blockName );
+ if ( fs.existsSync( blockPhpDir ) ) {
+ fs.cpSync( blockPhpDir, blockDest, {
+ recursive: true,
+ filter: ( src ) => {
+ // Allow directories (needed for recursion) and PHP files (except index.php which is handled above)
+ const stat = fs.statSync( src );
+ if ( stat.isDirectory() ) {
+ return true;
+ }
+ return src.endsWith( '.php' ) && ! src.endsWith( '/index.php' ) && ! src.endsWith( '\\index.php' );
+ },
+ } );
+ }
}
console.log(
From 361dc81122e77131553327a526310836168bd6aa Mon Sep 17 00:00:00 2001
From: ella
Date: Mon, 9 Feb 2026 11:03:34 +0100
Subject: [PATCH 3/7] Adjust old files
---
src/wp-admin/includes/update-core.php | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php
index 2f8045e8d193f..47cbc9e16fb64 100644
--- a/src/wp-admin/includes/update-core.php
+++ b/src/wp-admin/includes/update-core.php
@@ -840,10 +840,6 @@
'wp-includes/js/dist/fields.min.js',
'wp-includes/js/dist/fields.js',
// 6.9
- 'wp-includes/blocks/post-author/editor.css',
- 'wp-includes/blocks/post-author/editor.min.css',
- 'wp-includes/blocks/post-author/editor-rtl.css',
- 'wp-includes/blocks/post-author/editor-rtl.min.css',
'wp-includes/SimplePie/src/Decode',
'wp-includes/SimplePie/src/Core.php',
);
From dc95abcf9868451ab8b8caadf6c8488142c85010 Mon Sep 17 00:00:00 2001
From: ella
Date: Mon, 9 Feb 2026 12:20:00 +0100
Subject: [PATCH 4/7] Update logic to avoid empty folders and only skip root
index.php
---
tools/gutenberg/copy-gutenberg-build.js | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tools/gutenberg/copy-gutenberg-build.js b/tools/gutenberg/copy-gutenberg-build.js
index 0280d2112a645..e5332f806f74a 100644
--- a/tools/gutenberg/copy-gutenberg-build.js
+++ b/tools/gutenberg/copy-gutenberg-build.js
@@ -263,15 +263,18 @@ function copyBlockAssets( config ) {
// 4. Copy PHP subdirectories from packages (e.g., shared/helpers.php)
const blockPhpDir = path.join( phpSrc, blockName );
if ( fs.existsSync( blockPhpDir ) ) {
+ const rootIndex = path.join( blockPhpDir, 'index.php' );
fs.cpSync( blockPhpDir, blockDest, {
recursive: true,
- filter: ( src ) => {
- // Allow directories (needed for recursion) and PHP files (except index.php which is handled above)
+ filter: function hasPhpFiles( src ) {
const stat = fs.statSync( src );
if ( stat.isDirectory() ) {
- return true;
+ return fs.readdirSync( src, { withFileTypes: true } ).some(
+ ( entry ) => hasPhpFiles( path.join( src, entry.name ) )
+ );
}
- return src.endsWith( '.php' ) && ! src.endsWith( '/index.php' ) && ! src.endsWith( '\\index.php' );
+ // Copy PHP files, but skip root index.php (handled by step 3)
+ return src.endsWith( '.php' ) && src !== rootIndex;
},
} );
}
From 4accdb91620ffee2cde36e4fb1aa5eb51a59af17 Mon Sep 17 00:00:00 2001
From: ella
Date: Mon, 9 Feb 2026 14:50:49 +0100
Subject: [PATCH 5/7] Tests: Update expected output for paragraph block class
Update test fixtures and assertions to account for the new
`wp-block-paragraph` class added to paragraph blocks.
Co-Authored-By: Claude Opus 4.5
---
.../data/blocks/do-blocks-expected.html | 4 +--
.../blocks/fixtures/core__column.server.html | 12 +++----
.../blocks/fixtures/core__columns.server.html | 32 +++++++++----------
.../core__columns__deprecated.server.html | 24 +++++++-------
.../fixtures/core__media-text.server.html | 2 +-
...media-text__image-alt-no-align.server.html | 2 +-
...dia-text__is-stacked-on-mobile.server.html | 2 +-
...text__media-right-custom-width.server.html | 2 +-
.../core__media-text__video.server.html | 2 +-
.../core__paragraph__align-right.server.html | 2 +-
.../tests/block-bindings/postMetaSource.php | 18 +++++------
tests/phpunit/tests/block-bindings/render.php | 10 +++---
tests/phpunit/tests/blocks/render.php | 3 ++
tests/phpunit/tests/blocks/renderReusable.php | 4 +--
.../tests/formatting/excerptRemoveBlocks.php | 8 ++---
tests/phpunit/tests/post/output.php | 8 ++---
.../rest-api/rest-widgets-controller.php | 2 +-
17 files changed, 70 insertions(+), 67 deletions(-)
diff --git a/tests/phpunit/data/blocks/do-blocks-expected.html b/tests/phpunit/data/blocks/do-blocks-expected.html
index f413182051334..f46ab0b7628c5 100644
--- a/tests/phpunit/data/blocks/do-blocks-expected.html
+++ b/tests/phpunit/data/blocks/do-blocks-expected.html
@@ -3,7 +3,7 @@
-First Gutenberg Paragraph
+First Gutenberg Paragraph
Second Auto Paragraph
@@ -11,7 +11,7 @@
-Third Gutenberg Paragraph
+Third Gutenberg Paragraph
Third Auto Paragraph
diff --git a/tests/phpunit/data/blocks/fixtures/core__column.server.html b/tests/phpunit/data/blocks/fixtures/core__column.server.html
index d0b6ab4016d91..2487ea0f93c9b 100644
--- a/tests/phpunit/data/blocks/fixtures/core__column.server.html
+++ b/tests/phpunit/data/blocks/fixtures/core__column.server.html
@@ -1,10 +1,10 @@
-
-
Column One, Paragraph One
-
-
-
Column One, Paragraph Two
-
+
+
Column One, Paragraph One
+
+
+
Column One, Paragraph Two
+
diff --git a/tests/phpunit/data/blocks/fixtures/core__columns.server.html b/tests/phpunit/data/blocks/fixtures/core__columns.server.html
index 5b5faf4f3d7a4..fa39f71320056 100644
--- a/tests/phpunit/data/blocks/fixtures/core__columns.server.html
+++ b/tests/phpunit/data/blocks/fixtures/core__columns.server.html
@@ -1,24 +1,24 @@
-
+
-
-
Column One, Paragraph One
-
-
-
Column One, Paragraph Two
-
+
+
Column One, Paragraph One
+
+
+
Column One, Paragraph Two
+
-
-
+
+
-
-
Column Two, Paragraph One
-
-
-
Column Three, Paragraph One
-
+
+
Column Two, Paragraph One
+
+
+
Column Three, Paragraph One
+
-
+
diff --git a/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.server.html b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.server.html
index b19349744dfbc..af37434febcf8 100644
--- a/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.server.html
+++ b/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.server.html
@@ -1,16 +1,16 @@
-
-
Column One, Paragraph One
-
-
-
Column One, Paragraph Two
-
-
-
Column Two, Paragraph One
-
-
-
Column Three, Paragraph One
-
+
+
Column One, Paragraph One
+
+
+
Column One, Paragraph Two
+
+
+
Column Two, Paragraph One
+
+
+
Column Three, Paragraph One
+
diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text.server.html b/tests/phpunit/data/blocks/fixtures/core__media-text.server.html
index e472aeb90e182..9093acb972b23 100644
--- a/tests/phpunit/data/blocks/fixtures/core__media-text.server.html
+++ b/tests/phpunit/data/blocks/fixtures/core__media-text.server.html
@@ -5,7 +5,7 @@
-
My Content
+
My Content
diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.server.html b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.server.html
index c25f5431b6809..15d5feec2b849 100644
--- a/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.server.html
+++ b/tests/phpunit/data/blocks/fixtures/core__media-text__image-alt-no-align.server.html
@@ -5,7 +5,7 @@
diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.server.html b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.server.html
index 5a1c3993f54c9..a8ddd142e6c00 100644
--- a/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.server.html
+++ b/tests/phpunit/data/blocks/fixtures/core__media-text__is-stacked-on-mobile.server.html
@@ -5,7 +5,7 @@
-
My Content
+
My Content
diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.server.html b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.server.html
index 41edc3e02ebb8..2c2cbe3da310d 100644
--- a/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.server.html
+++ b/tests/phpunit/data/blocks/fixtures/core__media-text__media-right-custom-width.server.html
@@ -5,7 +5,7 @@
diff --git a/tests/phpunit/data/blocks/fixtures/core__media-text__video.server.html b/tests/phpunit/data/blocks/fixtures/core__media-text__video.server.html
index 88e9393dd75f2..4328c16b367a0 100644
--- a/tests/phpunit/data/blocks/fixtures/core__media-text__video.server.html
+++ b/tests/phpunit/data/blocks/fixtures/core__media-text__video.server.html
@@ -5,7 +5,7 @@
-
My Content
+
My Content
diff --git a/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.server.html b/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.server.html
index 1db164ca1fb5b..4c6b5d6ffad0a 100644
--- a/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.server.html
+++ b/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.server.html
@@ -1,3 +1,3 @@
-... like this one, which is separate from the above and right aligned.
+... like this one, which is separate from the above and right aligned.
diff --git a/tests/phpunit/tests/block-bindings/postMetaSource.php b/tests/phpunit/tests/block-bindings/postMetaSource.php
index 927d290f80557..555376e1c6b0c 100644
--- a/tests/phpunit/tests/block-bindings/postMetaSource.php
+++ b/tests/phpunit/tests/block-bindings/postMetaSource.php
@@ -68,7 +68,7 @@ public function test_custom_field_value_is_rendered() {
$content = $this->get_modified_post_content( 'Fallback value
' );
$this->assertSame(
- 'Custom field value
',
+ 'Custom field value
',
$content,
'The post content should show the value of the custom field . '
);
@@ -123,7 +123,7 @@ public function test_custom_field_value_is_not_shown_in_password_protected_posts
remove_filter( 'post_password_required', '__return_true' );
$this->assertSame(
- 'Fallback value
',
+ 'Fallback value
',
$content,
'The post content should show the fallback value instead of the custom field value.'
);
@@ -153,7 +153,7 @@ public function test_custom_field_value_is_not_shown_in_non_viewable_posts() {
remove_filter( 'is_post_status_viewable', '__return_false' );
$this->assertSame(
- 'Fallback value
',
+ 'Fallback value
',
$content,
'The post content should show the fallback value instead of the custom field value.'
);
@@ -168,7 +168,7 @@ public function test_binding_to_non_existing_meta_key() {
$content = $this->get_modified_post_content( 'Fallback value
' );
$this->assertSame(
- 'Fallback value
',
+ 'Fallback value
',
$content,
'The post content should show the fallback value.'
);
@@ -183,7 +183,7 @@ public function test_binding_without_key_renders_the_fallback() {
$content = $this->get_modified_post_content( 'Fallback value
' );
$this->assertSame(
- 'Fallback value
',
+ 'Fallback value
',
$content,
'The post content should show the fallback value.'
);
@@ -209,7 +209,7 @@ public function test_protected_field_value_is_not_shown() {
$content = $this->get_modified_post_content( 'Fallback value
' );
$this->assertSame(
- 'Fallback value
',
+ 'Fallback value
',
$content,
'The post content should show the fallback value instead of the protected value.'
);
@@ -235,7 +235,7 @@ public function test_custom_field_not_exposed_in_rest_api_is_not_shown() {
$content = $this->get_modified_post_content( 'Fallback value
' );
$this->assertSame(
- 'Fallback value
',
+ 'Fallback value
',
$content,
'The post content should show the fallback value instead of the protected value.'
);
@@ -261,7 +261,7 @@ public function test_custom_field_with_unsafe_html_is_sanitized() {
$content = $this->get_modified_post_content( 'Fallback value
' );
$this->assertSame(
- 'alert(“Unsafe HTML”)
',
+ 'alert(“Unsafe HTML”)
',
$content,
'The post content should not include the script tag.'
);
@@ -298,7 +298,7 @@ public function test_filter_block_bindings_source_value() {
remove_filter( 'block_bindings_source_value', $filter_value );
$this->assertSame(
- 'Filtered value: tests_filter_field
',
+ 'Filtered value: tests_filter_field
',
$content,
'The post content should show the filtered value.'
);
diff --git a/tests/phpunit/tests/block-bindings/render.php b/tests/phpunit/tests/block-bindings/render.php
index fa8178cbd39b2..77b0975105dc5 100644
--- a/tests/phpunit/tests/block-bindings/render.php
+++ b/tests/phpunit/tests/block-bindings/render.php
@@ -90,7 +90,7 @@ public function data_update_block_with_value_from_source() {
HTML
,
- 'test source value
',
+ 'test source value
',
),
'button block' => array(
'text',
@@ -179,19 +179,19 @@ function ( $source_args, $block_instance, $attribute_name ) {
$value = $source_args['key'];
return "The attribute name is '$attribute_name' and its binding has argument 'key' with value '$value'.";
},
- "The attribute name is 'content' and its binding has argument 'key' with value 'test'.
",
+ "The attribute name is 'content' and its binding has argument 'key' with value 'test'.
",
),
'unsafe HTML should be sanitized' => array(
function () {
return '';
},
- 'alert("Unsafe HTML")
',
+ 'alert("Unsafe HTML")
',
),
'symbols and numbers should be rendered correctly' => array(
function () {
return '$12.50';
},
- '$12.50
',
+ '$12.50
',
),
);
}
@@ -418,7 +418,7 @@ public function test_filter_block_bindings_source_value() {
remove_filter( 'block_bindings_source_value', $filter_value );
$this->assertSame(
- 'Filtered value: test_arg. Block instance: core/paragraph. Attribute name: content.
',
+ 'Filtered value: test_arg. Block instance: core/paragraph. Attribute name: content.
',
trim( $result ),
'The block content should show the filtered value.'
);
diff --git a/tests/phpunit/tests/blocks/render.php b/tests/phpunit/tests/blocks/render.php
index 84b2382a4affe..7b20dac147601 100644
--- a/tests/phpunit/tests/blocks/render.php
+++ b/tests/phpunit/tests/blocks/render.php
@@ -75,6 +75,9 @@ public function test_the_content() {
// Block rendering add some extra blank lines, but we're not worried about them.
$block_filtered_content = preg_replace( "/\n{2,}/", "\n", $block_filtered_content );
+ // Paragraph blocks now add a class, strip it for comparison with classic content.
+ $block_filtered_content = str_replace( ' class="wp-block-paragraph"', '', $block_filtered_content );
+
remove_shortcode( 'someshortcode' );
$this->assertSame( trim( $classic_filtered_content ), trim( $block_filtered_content ) );
diff --git a/tests/phpunit/tests/blocks/renderReusable.php b/tests/phpunit/tests/blocks/renderReusable.php
index 0a88818394780..f38ae41a41173 100644
--- a/tests/phpunit/tests/blocks/renderReusable.php
+++ b/tests/phpunit/tests/blocks/renderReusable.php
@@ -83,7 +83,7 @@ public function test_render() {
);
$block = new WP_Block( $parsed_block );
$output = $block->render();
- $this->assertSame( 'Hello world!
', $output );
+ $this->assertSame( 'Hello world!
', $output );
}
/**
@@ -99,7 +99,7 @@ public function test_render_subsequent() {
$block = new WP_Block( $parsed_block );
$output = $block->render();
$output .= $block->render();
- $this->assertSame( 'Hello world!
Hello world!
', $output );
+ $this->assertSame( 'Hello world!
Hello world!
', $output );
}
public function test_ref_empty() {
diff --git a/tests/phpunit/tests/formatting/excerptRemoveBlocks.php b/tests/phpunit/tests/formatting/excerptRemoveBlocks.php
index 1f07596903fbf..2097c35bbf5b8 100644
--- a/tests/phpunit/tests/formatting/excerptRemoveBlocks.php
+++ b/tests/phpunit/tests/formatting/excerptRemoveBlocks.php
@@ -12,7 +12,7 @@ class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase {
public $content = '
-paragraph
+paragraph
@@ -25,7 +25,7 @@ class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase {
- paragraph inside column
+ paragraph inside column
@@ -35,12 +35,12 @@ class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase {
public $filtered_content = '
-paragraph
+paragraph
- paragraph inside column
+ paragraph inside column
';
diff --git a/tests/phpunit/tests/post/output.php b/tests/phpunit/tests/post/output.php
index a08f7524eefab..c1d04303161ab 100644
--- a/tests/phpunit/tests/post/output.php
+++ b/tests/phpunit/tests/post/output.php
@@ -202,13 +202,13 @@ public function test_the_content_should_handle_more_block_on_singular() {
$expected_without_teaser = <<
-Second block.
+Second block.
EOF;
$expected_with_teaser = <<Teaser part.
+Teaser part.
-Second block.
+Second block.
EOF;
$this->go_to( get_permalink( $post_id ) );
@@ -253,7 +253,7 @@ public function test_the_content_should_handle_more_block_when_noteaser_on_singu
$expected = <<
-Second block.
+Second block.
EOF;
$this->go_to( get_permalink( $post_id ) );
diff --git a/tests/phpunit/tests/rest-api/rest-widgets-controller.php b/tests/phpunit/tests/rest-api/rest-widgets-controller.php
index 246ad3b61eb09..27a58eb638f9c 100644
--- a/tests/phpunit/tests/rest-api/rest-widgets-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-widgets-controller.php
@@ -406,7 +406,7 @@ public function test_get_items() {
'id' => 'block-1',
'id_base' => 'block',
'sidebar' => 'sidebar-1',
- 'rendered' => 'Block test
',
+ 'rendered' => 'Block test
',
),
array(
'id' => 'rss-1',
From b40d2f950cf6b75e14b71a50906268aea810fe67 Mon Sep 17 00:00:00 2001
From: ella
Date: Mon, 9 Feb 2026 15:29:32 +0100
Subject: [PATCH 6/7] Fix remaining tests
---
.../rest-api/endpoints/class-wp-rest-posts-controller.php | 4 ++--
tests/phpunit/includes/unregister-blocks-hooks.php | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
index 14afb8c2eeddf..a69ce9fa95454 100644
--- a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
+++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
@@ -1988,7 +1988,7 @@ public function prepare_item_for_response( $item, $request ) {
add_filter(
'excerpt_length',
$override_excerpt_length,
- 20
+ PHP_INT_MAX
);
}
@@ -2008,7 +2008,7 @@ public function prepare_item_for_response( $item, $request ) {
remove_filter(
'excerpt_length',
$override_excerpt_length,
- 20
+ PHP_INT_MAX
);
}
}
diff --git a/tests/phpunit/includes/unregister-blocks-hooks.php b/tests/phpunit/includes/unregister-blocks-hooks.php
index b67936a103c81..e40d5b9d13b03 100644
--- a/tests/phpunit/includes/unregister-blocks-hooks.php
+++ b/tests/phpunit/includes/unregister-blocks-hooks.php
@@ -6,6 +6,7 @@
remove_action( 'init', 'register_block_core_archives' );
remove_action( 'init', 'register_block_core_avatar' );
remove_action( 'init', 'register_block_core_block' );
+remove_action( 'init', 'register_block_core_breadcrumbs' );
remove_action( 'init', 'register_block_core_button' );
remove_action( 'init', 'register_block_core_calendar' );
remove_action( 'init', 'register_block_core_categories' );
@@ -38,6 +39,7 @@
remove_action( 'init', 'register_block_core_navigation_submenu' );
remove_action( 'init', 'register_block_core_page_list' );
remove_action( 'init', 'register_block_core_page_list_item' );
+remove_action( 'init', 'register_block_core_paragraph' );
remove_action( 'init', 'register_block_core_pattern' );
remove_action( 'init', 'register_block_core_post_author' );
remove_action( 'init', 'register_block_core_post_author_biography' );
From a1ea1e74c41a0538d05176a6a0ad073a85a65932 Mon Sep 17 00:00:00 2001
From: ella
Date: Mon, 9 Feb 2026 15:46:02 +0100
Subject: [PATCH 7/7] Dynamic unregister
---
.../includes/unregister-blocks-hooks.php | 91 +++----------------
1 file changed, 12 insertions(+), 79 deletions(-)
diff --git a/tests/phpunit/includes/unregister-blocks-hooks.php b/tests/phpunit/includes/unregister-blocks-hooks.php
index e40d5b9d13b03..116b4191766bb 100644
--- a/tests/phpunit/includes/unregister-blocks-hooks.php
+++ b/tests/phpunit/includes/unregister-blocks-hooks.php
@@ -1,81 +1,14 @@