From 42e0df64acec907c1cbd96006b402ee8ddc1b5a9 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 25 Oct 2022 10:56:39 +0400 Subject: [PATCH 1/2] Fix failing PHPUnit tests --- lib/compat/wordpress-6.0/client-assets.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/compat/wordpress-6.0/client-assets.php b/lib/compat/wordpress-6.0/client-assets.php index 0c5697817a94a8..9c8d6398c6364f 100644 --- a/lib/compat/wordpress-6.0/client-assets.php +++ b/lib/compat/wordpress-6.0/client-assets.php @@ -105,6 +105,10 @@ function gutenberg_resolve_assets() { add_filter( 'block_editor_settings_all', function( $settings ) { + if ( function_exists( '_wp_get_iframed_editor_assets' ) ) { + return $settings; + } + // In the future we can allow WP Dependency handles to be passed. $settings['__unstableResolvedAssets'] = gutenberg_resolve_assets(); return $settings; From aff5ca84a06982ffc7346d960e176a0908bcfa12 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 25 Oct 2022 12:49:10 +0400 Subject: [PATCH 2/2] Add inline comment Co-authored-by: Bernie Reiter --- lib/compat/wordpress-6.0/client-assets.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/compat/wordpress-6.0/client-assets.php b/lib/compat/wordpress-6.0/client-assets.php index 9c8d6398c6364f..f9affb31af4b52 100644 --- a/lib/compat/wordpress-6.0/client-assets.php +++ b/lib/compat/wordpress-6.0/client-assets.php @@ -105,6 +105,7 @@ function gutenberg_resolve_assets() { add_filter( 'block_editor_settings_all', function( $settings ) { + // The `__unstableResolvedAssets` are generated by `_wp_get_iframed_editor_assets` for WP >= 6.0. if ( function_exists( '_wp_get_iframed_editor_assets' ) ) { return $settings; }