Editor: Use static closures to avoid memory leaks.

Backports Gutenberg changes from https://github.com/WordPress/gutenberg/pull/50723.

Amends [55822].

Fixes #58323.
Props westonruter, spacedmonkey, flixos90. 

Built from https://develop.svn.wordpress.org/trunk@56038


git-svn-id: http://core.svn.wordpress.org/trunk@55550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2023-06-26 17:00:25 +00:00
parent 5ca27acd20
commit 33f71c4662
3 changed files with 3 additions and 3 deletions

View File

@ -2423,7 +2423,7 @@ class WP_Theme_JSON {
$pseudo_matches = array_values(
array_filter(
$element_pseudo_allowed,
function( $pseudo_selector ) use ( $selector ) {
static function( $pseudo_selector ) use ( $selector ) {
return str_contains( $selector, $pseudo_selector );
}
)

View File

@ -370,7 +370,7 @@ function wp_add_global_styles_for_blocks() {
$result = array_values(
array_filter(
$metadata['path'],
function ( $item ) {
static function ( $item ) {
if ( str_contains( $item, 'core/' ) ) {
return true;
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-alpha-56037';
$wp_version = '6.3-alpha-56038';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.