diff --git a/backport-changelog/6.7/7179.md b/backport-changelog/6.7/7179.md index f359b6610a94e6..a6e9cc4efe2cd0 100644 --- a/backport-changelog/6.7/7179.md +++ b/backport-changelog/6.7/7179.md @@ -1,3 +1,4 @@ https://github.com/WordPress/wordpress-develop/pull/7179 * https://github.com/WordPress/gutenberg/pull/64401 +* https://github.com/WordPress/gutenberg/pull/64459 diff --git a/lib/compat/wordpress-6.7/rest-api.php b/lib/compat/wordpress-6.7/rest-api.php index fe2aac9c2580ae..2520a06fbb18be 100644 --- a/lib/compat/wordpress-6.7/rest-api.php +++ b/lib/compat/wordpress-6.7/rest-api.php @@ -26,6 +26,24 @@ function gutenberg_block_editor_preload_paths_6_7( $paths, $context ) { } } + if ( 'core/edit-post' === $context->name ) { + $reusable_blocks_key = array_search( + add_query_arg( + array( + 'context' => 'edit', + 'per_page' => -1, + ), + rest_get_route_for_post_type_items( 'wp_block' ) + ), + $paths, + true + ); + + if ( false !== $parts_key ) { + unset( $paths[ $reusable_blocks_key ] ); + } + } + return $paths; } add_filter( 'block_editor_rest_api_preload_paths', 'gutenberg_block_editor_preload_paths_6_7', 10, 2 );