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:
Weston Ruter
2023-06-26 16:58:38 +00:00
parent b6fde03ef7
commit c7597fa62f
3 changed files with 3 additions and 3 deletions

View File

@@ -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;
}