From ee1039a4c65c93beac64dd2bb4f610d357022685 Mon Sep 17 00:00:00 2001 From: Dovid Levine Date: Sat, 2 Nov 2024 19:54:17 +0200 Subject: [PATCH 1/2] fix: wrong number of `$accepted_args` on `add_filter()` calls --- lib/block-supports/block-style-variations.php | 2 +- lib/experimental/kses-allowed-html.php | 2 +- lib/rest-api.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/block-supports/block-style-variations.php b/lib/block-supports/block-style-variations.php index 3942fed24b98a8..99e6e89abcd843 100644 --- a/lib/block-supports/block-style-variations.php +++ b/lib/block-supports/block-style-variations.php @@ -273,7 +273,7 @@ function gutenberg_enqueue_block_style_variation_styles() { } // Add Gutenberg filters and action. -add_filter( 'render_block_data', 'gutenberg_render_block_style_variation_support_styles', 10, 2 ); +add_filter( 'render_block_data', 'gutenberg_render_block_style_variation_support_styles', 10, 1 ); add_filter( 'render_block', 'gutenberg_render_block_style_variation_class_name', 10, 2 ); add_action( 'wp_enqueue_scripts', 'gutenberg_enqueue_block_style_variation_styles', 1 ); diff --git a/lib/experimental/kses-allowed-html.php b/lib/experimental/kses-allowed-html.php index 122faef7b4ca2c..220853af557394 100644 --- a/lib/experimental/kses-allowed-html.php +++ b/lib/experimental/kses-allowed-html.php @@ -40,4 +40,4 @@ function gutenberg_kses_allowed_html( $allowedtags ) { ); return $allowedtags; } -add_filter( 'wp_kses_allowed_html', 'gutenberg_kses_allowed_html', 10, 2 ); +add_filter( 'wp_kses_allowed_html', 'gutenberg_kses_allowed_html', 10, 1 ); diff --git a/lib/rest-api.php b/lib/rest-api.php index 7570bb19737233..0cc22e02c5b674 100644 --- a/lib/rest-api.php +++ b/lib/rest-api.php @@ -27,7 +27,7 @@ function gutenberg_override_global_styles_endpoint( array $args ): array { return $args; } -add_filter( 'register_wp_global_styles_post_type_args', 'gutenberg_override_global_styles_endpoint', 10, 2 ); +add_filter( 'register_wp_global_styles_post_type_args', 'gutenberg_override_global_styles_endpoint', 10, 1 ); /** * Registers the Edit Site Export REST API routes. From 0beec7cecdf96caa0db5432eeeda8b0d963e4ebe Mon Sep 17 00:00:00 2001 From: Dovid Levine Date: Sat, 28 Dec 2024 16:11:21 +0200 Subject: [PATCH 2/2] fix: use default priority/accepted_args --- lib/block-supports/block-style-variations.php | 2 +- lib/experimental/kses-allowed-html.php | 2 +- lib/rest-api.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/block-supports/block-style-variations.php b/lib/block-supports/block-style-variations.php index 99e6e89abcd843..7285b9e0c7330b 100644 --- a/lib/block-supports/block-style-variations.php +++ b/lib/block-supports/block-style-variations.php @@ -273,7 +273,7 @@ function gutenberg_enqueue_block_style_variation_styles() { } // Add Gutenberg filters and action. -add_filter( 'render_block_data', 'gutenberg_render_block_style_variation_support_styles', 10, 1 ); +add_filter( 'render_block_data', 'gutenberg_render_block_style_variation_support_styles' ); add_filter( 'render_block', 'gutenberg_render_block_style_variation_class_name', 10, 2 ); add_action( 'wp_enqueue_scripts', 'gutenberg_enqueue_block_style_variation_styles', 1 ); diff --git a/lib/experimental/kses-allowed-html.php b/lib/experimental/kses-allowed-html.php index 220853af557394..9a4f2e7c614b80 100644 --- a/lib/experimental/kses-allowed-html.php +++ b/lib/experimental/kses-allowed-html.php @@ -40,4 +40,4 @@ function gutenberg_kses_allowed_html( $allowedtags ) { ); return $allowedtags; } -add_filter( 'wp_kses_allowed_html', 'gutenberg_kses_allowed_html', 10, 1 ); +add_filter( 'wp_kses_allowed_html', 'gutenberg_kses_allowed_html' ); diff --git a/lib/rest-api.php b/lib/rest-api.php index 0cc22e02c5b674..cc9e1be17e4174 100644 --- a/lib/rest-api.php +++ b/lib/rest-api.php @@ -27,7 +27,7 @@ function gutenberg_override_global_styles_endpoint( array $args ): array { return $args; } -add_filter( 'register_wp_global_styles_post_type_args', 'gutenberg_override_global_styles_endpoint', 10, 1 ); +add_filter( 'register_wp_global_styles_post_type_args', 'gutenberg_override_global_styles_endpoint' ); /** * Registers the Edit Site Export REST API routes.