Make WordPress Core

Changeset 51981 for branches/5.8


Ignore:
Timestamp:
11/02/2021 06:21:29 PM (3 years ago)
Author:
desrosj
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, SergeyBiryukov.
Merges [54323] to the 5.8 branch.
Fixes #54323.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/wp-includes/script-loader.php

    r51696 r51981  
    24452445                    add_filter(
    24462446                        'render_block',
    2447                         function( $html, $block ) use ( $style_properties ) {
     2447                        function( $html ) use ( $style_properties ) {
    24482448                            wp_enqueue_style( $style_properties['style_handle'] );
    24492449                            return $html;
Note: See TracChangeset for help on using the changeset viewer.