From 5585283324f3795f3b1c17c30e6003a74ec3505f Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Tue, 17 Jan 2023 17:20:04 +0100 Subject: [PATCH] Blocks: move away from deprecated methods in multiple blocks This commit also updates the mustache template that is used to create new blocks, since that's why that deprecated method was added to those blocks in the first place. --- .../jetpack/changelog/fix-deprecated-methods-block-classes | 4 ++++ .../plugins/jetpack/extensions/blocks/ai-image/ai-image.php | 2 +- .../jetpack/extensions/blocks/ai-paragraph/ai-paragraph.php | 2 +- .../jetpack/modules/memberships/class-jetpack-memberships.php | 2 +- .../jetpack/wp-cli-templates/block-register-php.mustache | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 projects/plugins/jetpack/changelog/fix-deprecated-methods-block-classes diff --git a/projects/plugins/jetpack/changelog/fix-deprecated-methods-block-classes b/projects/plugins/jetpack/changelog/fix-deprecated-methods-block-classes new file mode 100644 index 0000000000000..865b5977aa287 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-deprecated-methods-block-classes @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Blocks: move away from deprecated methods in multiple blocks. diff --git a/projects/plugins/jetpack/extensions/blocks/ai-image/ai-image.php b/projects/plugins/jetpack/extensions/blocks/ai-image/ai-image.php index 55cf83ee9b87d..b86ec4b7967b0 100644 --- a/projects/plugins/jetpack/extensions/blocks/ai-image/ai-image.php +++ b/projects/plugins/jetpack/extensions/blocks/ai-image/ai-image.php @@ -52,7 +52,7 @@ function load_assets( $attr, $content ) { return sprintf( '
%2$s
', - esc_attr( Jetpack_Gutenberg::block_classes( FEATURE_NAME, $attr ) ), + esc_attr( Blocks::classes( FEATURE_NAME, $attr ) ), $content ); } diff --git a/projects/plugins/jetpack/extensions/blocks/ai-paragraph/ai-paragraph.php b/projects/plugins/jetpack/extensions/blocks/ai-paragraph/ai-paragraph.php index 9ed30c936cb5e..f039bf0ff2c20 100644 --- a/projects/plugins/jetpack/extensions/blocks/ai-paragraph/ai-paragraph.php +++ b/projects/plugins/jetpack/extensions/blocks/ai-paragraph/ai-paragraph.php @@ -52,7 +52,7 @@ function load_assets( $attr, $content ) { return sprintf( '
%2$s
', - esc_attr( Jetpack_Gutenberg::block_classes( FEATURE_NAME, $attr ) ), + esc_attr( Blocks::classes( FEATURE_NAME, $attr ) ), $content ); } diff --git a/projects/plugins/jetpack/modules/memberships/class-jetpack-memberships.php b/projects/plugins/jetpack/modules/memberships/class-jetpack-memberships.php index 6b17aae6a3e0b..3b7517f9d8983 100644 --- a/projects/plugins/jetpack/modules/memberships/class-jetpack-memberships.php +++ b/projects/plugins/jetpack/modules/memberships/class-jetpack-memberships.php @@ -378,7 +378,7 @@ public function deprecated_render_button_v1( $attrs, $plan_id ) { return sprintf( '
%5$s
', esc_attr( - Jetpack_Gutenberg::block_classes( + Blocks::classes( self::$button_block_name, $attrs, array( 'wp-block-button' ) diff --git a/projects/plugins/jetpack/wp-cli-templates/block-register-php.mustache b/projects/plugins/jetpack/wp-cli-templates/block-register-php.mustache index a27f0ebc9772d..e22d9b128309d 100644 --- a/projects/plugins/jetpack/wp-cli-templates/block-register-php.mustache +++ b/projects/plugins/jetpack/wp-cli-templates/block-register-php.mustache @@ -44,7 +44,7 @@ function load_assets( $attr, $content ) { return sprintf( '
%2$s
', - esc_attr( Jetpack_Gutenberg::block_classes( FEATURE_NAME, $attr ) ), + esc_attr( Blocks::classes( FEATURE_NAME, $attr ) ), $content ); }