From 0b4e818b4bfccbe82c7a4e183e87e51ce5d85551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Tue, 21 Feb 2023 19:03:30 +0200 Subject: [PATCH] Update PHP --- .../block-supports-in-dynamic-blocks.md | 4 ++-- .../block-tutorial/creating-dynamic-blocks.md | 2 +- docs/how-to-guides/internationalization.md | 2 +- docs/how-to-guides/metabox.md | 2 +- packages/blocks/src/api/test/registration.js | 2 +- packages/server-side-render/README.md | 2 +- phpunit/block-supports/border-test.php | 2 +- phpunit/block-supports/colors-test.php | 6 +++--- phpunit/block-supports/dimensions-test.php | 6 +++--- phpunit/block-supports/position-test.php | 2 +- phpunit/block-supports/spacing-test.php | 6 +++--- phpunit/block-supports/typography-test.php | 14 +++++++------- phpunit/bootstrap.php | 2 +- phpunit/class-wp-theme-json-resolver-test.php | 2 +- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/how-to-guides/block-tutorial/block-supports-in-dynamic-blocks.md b/docs/how-to-guides/block-tutorial/block-supports-in-dynamic-blocks.md index dfc17fb43af81..dc022622c80c2 100644 --- a/docs/how-to-guides/block-tutorial/block-supports-in-dynamic-blocks.md +++ b/docs/how-to-guides/block-tutorial/block-supports-in-dynamic-blocks.md @@ -119,7 +119,7 @@ function gutenberg_examples_dynamic() { register_block_type( 'gutenberg-examples/example-dynamic', array( - 'api_version' => 2, + 'api_version' => 3, 'category' => 'widgets', 'attributes' => array( 'bgColor' => array( 'type' => 'string' ), @@ -195,7 +195,7 @@ function gutenberg_examples_dynamic_block_supports() { register_block_type( 'gutenberg-examples/example-dynamic-block-supports', array( - 'api_version' => 2, + 'api_version' => 3, 'category' => 'widgets', 'supports' => array( 'color' => true ), 'render_callback' => 'gutenberg_examples_dynamic_block_supports_render_callback', diff --git a/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md b/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md index c7633892b6ead..9d1e4dbdf5255 100644 --- a/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md +++ b/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md @@ -132,7 +132,7 @@ function gutenberg_examples_dynamic() { ); register_block_type( 'gutenberg-examples/example-dynamic', array( - 'api_version' => 2, + 'api_version' => 3, 'editor_script' => 'gutenberg-examples-dynamic', 'render_callback' => 'gutenberg_examples_dynamic_render_callback' ) ); diff --git a/docs/how-to-guides/internationalization.md b/docs/how-to-guides/internationalization.md index 47f4abf8ab6e6..af68da2719335 100644 --- a/docs/how-to-guides/internationalization.md +++ b/docs/how-to-guides/internationalization.md @@ -28,7 +28,7 @@ function myguten_block_init() { ); register_block_type( 'myguten/simple', array( - 'api_version' => 2, + 'api_version' => 3, 'editor_script' => 'myguten-script', ) ); } diff --git a/docs/how-to-guides/metabox.md b/docs/how-to-guides/metabox.md index 382afd602ed3d..7a8686968d2cf 100644 --- a/docs/how-to-guides/metabox.md +++ b/docs/how-to-guides/metabox.md @@ -152,7 +152,7 @@ function myguten_render_paragraph( $block_attributes, $content ) { } register_block_type( 'core/paragraph', array( - 'api_version' => 2, + 'api_version' => 3, 'render_callback' => 'myguten_render_paragraph', ) ); ``` diff --git a/packages/blocks/src/api/test/registration.js b/packages/blocks/src/api/test/registration.js index 086bbf2f2d64f..7bfb5da399c59 100644 --- a/packages/blocks/src/api/test/registration.js +++ b/packages/blocks/src/api/test/registration.js @@ -358,7 +358,7 @@ describe( 'blocks', () => { const blockName = 'core/test-block-with-incompatible-keys'; unstable__bootstrapServerSideBlockDefinitions( { [ blockName ]: { - api_version: 2, + api_version: 3, provides_context: { fontSize: 'fontSize', }, diff --git a/packages/server-side-render/README.md b/packages/server-side-render/README.md index 9c78086893147..ba6fae302ca0a 100644 --- a/packages/server-side-render/README.md +++ b/packages/server-side-render/README.md @@ -170,7 +170,7 @@ If you pass `attributes` to `ServerSideRender`, the block must also be registere register_block_type( 'core/archives', array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'showPostCounts' => array( 'type' => 'boolean', diff --git a/phpunit/block-supports/border-test.php b/phpunit/block-supports/border-test.php index 7c8bd9975d35b..858e4e92cc174 100644 --- a/phpunit/block-supports/border-test.php +++ b/phpunit/block-supports/border-test.php @@ -36,7 +36,7 @@ private function register_bordered_block_with_support( $block_name, $supports = register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'borderColor' => array( 'type' => 'string', diff --git a/phpunit/block-supports/colors-test.php b/phpunit/block-supports/colors-test.php index f21f6477f4162..310b7e6c525cb 100644 --- a/phpunit/block-supports/colors-test.php +++ b/phpunit/block-supports/colors-test.php @@ -28,7 +28,7 @@ public function test_color_slugs_with_numbers_are_kebab_cased_properly() { register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'textColor' => array( 'type' => 'string', @@ -69,7 +69,7 @@ public function test_color_with_skipped_serialization_block_supports() { register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', @@ -107,7 +107,7 @@ public function test_gradient_with_individual_skipped_serialization_block_suppor register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', diff --git a/phpunit/block-supports/dimensions-test.php b/phpunit/block-supports/dimensions-test.php index 2ec0859b7cb7f..d428977c2c0a6 100644 --- a/phpunit/block-supports/dimensions-test.php +++ b/phpunit/block-supports/dimensions-test.php @@ -28,7 +28,7 @@ public function test_dimensions_style_is_applied() { register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', @@ -64,7 +64,7 @@ public function test_dimensions_with_skipped_serialization_block_supports() { register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', @@ -99,7 +99,7 @@ public function test_min_height_with_individual_skipped_serialization_block_supp register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', diff --git a/phpunit/block-supports/position-test.php b/phpunit/block-supports/position-test.php index c304ffa68e7de..d9f97060cf647 100644 --- a/phpunit/block-supports/position-test.php +++ b/phpunit/block-supports/position-test.php @@ -78,7 +78,7 @@ public function test_position_block_support( $theme_name, $block_name, $position register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', diff --git a/phpunit/block-supports/spacing-test.php b/phpunit/block-supports/spacing-test.php index 1ac0c86e62042..93df6f55ac109 100644 --- a/phpunit/block-supports/spacing-test.php +++ b/phpunit/block-supports/spacing-test.php @@ -28,7 +28,7 @@ public function test_spacing_style_is_applied() { register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', @@ -73,7 +73,7 @@ public function test_spacing_with_skipped_serialization_block_supports() { register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', @@ -117,7 +117,7 @@ public function test_margin_with_individual_skipped_serialization_block_supports register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', diff --git a/phpunit/block-supports/typography-test.php b/phpunit/block-supports/typography-test.php index 1b9b6f97c63f6..94867b85f9448 100644 --- a/phpunit/block-supports/typography-test.php +++ b/phpunit/block-supports/typography-test.php @@ -78,7 +78,7 @@ public function test_should_kebab_case_font_size_slug_with_numbers() { register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'fontSize' => array( 'type' => 'string', @@ -112,7 +112,7 @@ public function test_should_generate_font_family_with_legacy_inline_styles_using register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', @@ -145,7 +145,7 @@ public function test_should_skip_serialization_for_typography_block_supports() { register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', @@ -191,7 +191,7 @@ public function test_should_skip_serialization_for_letter_spacing_block_supports register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', @@ -227,7 +227,7 @@ public function test_should_generate_css_var_for_font_family_with_legacy_inline_ register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', @@ -260,7 +260,7 @@ public function test_should_generate_classname_for_font_family() { register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', @@ -574,7 +574,7 @@ public function test_should_covert_font_sizes_to_fluid_values( $font_size_value, register_block_type( $this->test_block_name, array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'style' => array( 'type' => 'object', diff --git a/phpunit/bootstrap.php b/phpunit/bootstrap.php index fac777864200a..906b43cb7f232 100644 --- a/phpunit/bootstrap.php +++ b/phpunit/bootstrap.php @@ -105,7 +105,7 @@ function gutenberg_register_test_block_for_feature_selectors() { WP_Block_Type_Registry::get_instance()->register( 'test/test', array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'textColor' => array( 'type' => 'string', diff --git a/phpunit/class-wp-theme-json-resolver-test.php b/phpunit/class-wp-theme-json-resolver-test.php index 4cc34bf97b32c..1588aa4d60326 100644 --- a/phpunit/class-wp-theme-json-resolver-test.php +++ b/phpunit/class-wp-theme-json-resolver-test.php @@ -396,7 +396,7 @@ public function test_get_merged_data_returns_origin( $origin, $core_palette, $co register_block_type( 'my/block-with-styles', array( - 'api_version' => 2, + 'api_version' => 3, 'attributes' => array( 'borderColor' => array( 'type' => 'string',