mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@56038 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b6fde03ef7
commit
c7597fa62f
@ -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 );
|
||||
}
|
||||
)
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -4217,7 +4217,7 @@ EOF;
|
||||
$result = null;
|
||||
add_filter(
|
||||
'the_content',
|
||||
function( $content ) use ( &$result, $context ) {
|
||||
static function( $content ) use ( &$result, $context ) {
|
||||
$result = wp_get_loading_attr_default( $context );
|
||||
return $content;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user