Make WordPress Core

Changeset 51941


Ignore:
Timestamp:
10/27/2021 05:08:15 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r51897 r51941  
    24492449                    add_filter(
    24502450                        'render_block',
    2451                         function( $html, $block ) use ( $style_properties ) {
     2451                        function( $html ) use ( $style_properties ) {
    24522452                            wp_enqueue_style( $style_properties['style_handle'] );
    24532453                            return $html;
Note: See TracChangeset for help on using the changeset viewer.