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", 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', ); 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/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 @@
-

Content

+

Content

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 @@
-

My video

+

My video

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/includes/unregister-blocks-hooks.php b/tests/phpunit/includes/unregister-blocks-hooks.php index b67936a103c81..116b4191766bb 100644 --- a/tests/phpunit/includes/unregister-blocks-hooks.php +++ b/tests/phpunit/includes/unregister-blocks-hooks.php @@ -1,79 +1,14 @@ 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', diff --git a/tools/gutenberg/copy-gutenberg-build.js b/tools/gutenberg/copy-gutenberg-build.js index f123d3776617a..e5332f806f74a 100644 --- a/tools/gutenberg/copy-gutenberg-build.js +++ b/tools/gutenberg/copy-gutenberg-build.js @@ -259,6 +259,25 @@ 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 ) ) { + const rootIndex = path.join( blockPhpDir, 'index.php' ); + fs.cpSync( blockPhpDir, blockDest, { + recursive: true, + filter: function hasPhpFiles( src ) { + const stat = fs.statSync( src ); + if ( stat.isDirectory() ) { + return fs.readdirSync( src, { withFileTypes: true } ).some( + ( entry ) => hasPhpFiles( path.join( src, entry.name ) ) + ); + } + // Copy PHP files, but skip root index.php (handled by step 3) + return src.endsWith( '.php' ) && src !== rootIndex; + }, + } ); + } } console.log(