From 489260a45ae44b7a7ad6282040542079cb756782 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 27 Oct 2021 17:08:15 +0000 Subject: [PATCH] Script Loader: Correct the number of arguments passed to the closure in `enqueue_block_styles_assets()`. This avoids an `Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed` PHP fatal error when registering a block style with the `should_load_separate_core_block_assets` filter enabled. Follow-up to [51471]. Props aristath, shimon246, jrf, gziolo. Fixes #54323. git-svn-id: https://develop.svn.wordpress.org/trunk@51941 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/script-loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 71c56192ee..f90390e5c3 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -2448,7 +2448,7 @@ function enqueue_block_styles_assets() { if ( wp_should_load_separate_core_block_assets() ) { add_filter( 'render_block', - function( $html, $block ) use ( $style_properties ) { + function( $html ) use ( $style_properties ) { wp_enqueue_style( $style_properties['style_handle'] ); return $html; }