From 45d9d96df634cad90636defbba000b7fc5fcb525 Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Thu, 7 May 2026 20:42:02 -0400 Subject: [PATCH 1/9] Site Editor: preload initial canvas data --- lib/compat/wordpress-7.0/preload.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/compat/wordpress-7.0/preload.php b/lib/compat/wordpress-7.0/preload.php index 49318230eb0810..de6c5bbe9d4831 100644 --- a/lib/compat/wordpress-7.0/preload.php +++ b/lib/compat/wordpress-7.0/preload.php @@ -10,6 +10,30 @@ */ function gutenberg_block_editor_preload_paths_6_9( $paths, $context ) { if ( 'core/edit-site' === $context->name ) { + $template_parts = get_block_templates( array(), 'wp_template_part' ); + foreach ( $template_parts as $template_part ) { + if ( ! empty( $template_part->id ) ) { + $paths[] = '/wp/v2/template-parts/' . $template_part->id . '?context=edit'; + } + } + + $post_rest_route = rest_get_route_for_post_type_items( 'post' ); + foreach ( array( 10, 3 ) as $per_page ) { + $paths[] = add_query_arg( + array( + 'context' => 'edit', + 'offset' => 0, + 'order' => 'desc', + 'orderby' => 'date', + 'per_page' => $per_page, + 'ignore_sticky' => 'false', + ), + $post_rest_route + ); + } + + $paths[] = '/wp/v2/taxonomies?context=view'; + // Only prefetch for the root. If we preload it for all pages and it's not used // it won't be possible to invalidate. // To do: perhaps purge all preloaded paths when client side navigating. From 0c1341e78e257bb06d68475f97f77f26c98cc347 Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Thu, 7 May 2026 21:47:24 -0400 Subject: [PATCH 2/9] Add Core backport changelog entry --- backport-changelog/7.0/11766.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 backport-changelog/7.0/11766.md diff --git a/backport-changelog/7.0/11766.md b/backport-changelog/7.0/11766.md new file mode 100644 index 00000000000000..9dadfa25a997ab --- /dev/null +++ b/backport-changelog/7.0/11766.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/11766 + +* https://github.com/WordPress/gutenberg/pull/78075 From 16f91f03bf1f225032b99f81355b56c85ec6c1d1 Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Fri, 8 May 2026 16:58:49 -0400 Subject: [PATCH 3/9] Remove redundant template part ID check --- lib/compat/wordpress-7.0/preload.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/compat/wordpress-7.0/preload.php b/lib/compat/wordpress-7.0/preload.php index de6c5bbe9d4831..1191c14d93dd8d 100644 --- a/lib/compat/wordpress-7.0/preload.php +++ b/lib/compat/wordpress-7.0/preload.php @@ -12,9 +12,7 @@ function gutenberg_block_editor_preload_paths_6_9( $paths, $context ) { if ( 'core/edit-site' === $context->name ) { $template_parts = get_block_templates( array(), 'wp_template_part' ); foreach ( $template_parts as $template_part ) { - if ( ! empty( $template_part->id ) ) { - $paths[] = '/wp/v2/template-parts/' . $template_part->id . '?context=edit'; - } + $paths[] = '/wp/v2/template-parts/' . $template_part->id . '?context=edit'; } $post_rest_route = rest_get_route_for_post_type_items( 'post' ); From 16b4fe59d3392baaf9504397c4769300c2c9af10 Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Fri, 8 May 2026 18:58:13 -0400 Subject: [PATCH 4/9] Site Editor: preload route-aware canvas data --- lib/compat/wordpress-7.0/preload.php | 106 +++++++++++++++++++++++---- 1 file changed, 92 insertions(+), 14 deletions(-) diff --git a/lib/compat/wordpress-7.0/preload.php b/lib/compat/wordpress-7.0/preload.php index 1191c14d93dd8d..3e05b16fe69ed2 100644 --- a/lib/compat/wordpress-7.0/preload.php +++ b/lib/compat/wordpress-7.0/preload.php @@ -10,24 +10,102 @@ */ function gutenberg_block_editor_preload_paths_6_9( $paths, $context ) { if ( 'core/edit-site' === $context->name ) { - $template_parts = get_block_templates( array(), 'wp_template_part' ); - foreach ( $template_parts as $template_part ) { - $paths[] = '/wp/v2/template-parts/' . $template_part->id . '?context=edit'; + $template_slugs = array(); + $front_page = null; + if ( ! empty( $context->post ) && 'page' === $context->post->post_type ) { + $template_slugs[] = empty( $context->post->post_name ) ? 'page' : 'page-' . $context->post->post_name; + $template_slugs[] = 'page'; + } else { + $template_slugs[] = 'front-page'; + + if ( 'page' === get_option( 'show_on_front' ) ) { + $front_page = get_post( (int) get_option( 'page_on_front' ) ); + if ( $front_page instanceof WP_Post ) { + $template_slugs[] = empty( $front_page->post_name ) ? 'page' : 'page-' . $front_page->post_name; + $template_slugs[] = 'page'; + } + } else { + $template_slugs[] = 'home'; + } + + $template_slugs[] = 'index'; } - $post_rest_route = rest_get_route_for_post_type_items( 'post' ); - foreach ( array( 10, 3 ) as $per_page ) { + $template_slugs = array_values( array_unique( $template_slugs ) ); + $templates = get_block_templates( + array( + 'slug__in' => $template_slugs, + ), + 'wp_template' + ); + $priorities = array_flip( $template_slugs ); + + usort( + $templates, + static function ( $template_a, $template_b ) use ( $priorities ) { + return ( $priorities[ $template_a->slug ] ?? 999 ) - ( $priorities[ $template_b->slug ] ?? 999 ); + } + ); + + $template_part_ids = array(); + $has_query = false; + $walk_blocks = static function ( $blocks ) use ( &$walk_blocks, &$template_part_ids, &$has_query ) { + foreach ( $blocks as $block ) { + if ( 'core/template-part' === ( $block['blockName'] ?? '' ) && ! empty( $block['attrs']['slug'] ) ) { + $theme = ! empty( $block['attrs']['theme'] ) ? $block['attrs']['theme'] : get_stylesheet(); + $template_part_ids[] = $theme . '//' . $block['attrs']['slug']; + } + + if ( 'core/query' === ( $block['blockName'] ?? '' ) ) { + $has_query = true; + } + + if ( ! empty( $block['innerBlocks'] ) ) { + $walk_blocks( $block['innerBlocks'] ); + } + } + }; + + if ( ! empty( $templates ) && ! empty( $templates[0]->content ) ) { + $blocks = parse_blocks( $templates[0]->content ); + if ( function_exists( 'resolve_pattern_blocks' ) ) { + $blocks = resolve_pattern_blocks( $blocks ); + } + $walk_blocks( $blocks ); + } + + foreach ( array_unique( $template_part_ids ) as $template_part_id ) { + $paths[] = '/wp/v2/template-parts/' . $template_part_id . '?context=edit'; + } + + if ( $front_page instanceof WP_Post ) { + $route_for_front_page = rest_get_route_for_post( $front_page ); + if ( $route_for_front_page ) { + $paths[] = add_query_arg( 'context', 'edit', $route_for_front_page ); + } $paths[] = add_query_arg( - array( - 'context' => 'edit', - 'offset' => 0, - 'order' => 'desc', - 'orderby' => 'date', - 'per_page' => $per_page, - 'ignore_sticky' => 'false', - ), - $post_rest_route + 'slug', + empty( $front_page->post_name ) ? 'page' : 'page-' . $front_page->post_name, + '/wp/v2/templates/lookup' ); + $paths[] = '/wp/v2/types/page?context=edit'; + } + + if ( $has_query ) { + $post_rest_route = rest_get_route_for_post_type_items( 'post' ); + foreach ( array( 10, 3 ) as $per_page ) { + $paths[] = add_query_arg( + array( + 'context' => 'edit', + 'offset' => 0, + 'order' => 'desc', + 'orderby' => 'date', + 'per_page' => $per_page, + 'ignore_sticky' => 'false', + ), + $post_rest_route + ); + } } $paths[] = '/wp/v2/taxonomies?context=view'; From 2b12a207fe1a55aaf9ee4cfc690dd7b28f856716 Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Fri, 8 May 2026 19:02:13 -0400 Subject: [PATCH 5/9] Site Editor: simplify pattern block resolution --- lib/compat/wordpress-7.0/preload.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/compat/wordpress-7.0/preload.php b/lib/compat/wordpress-7.0/preload.php index 3e05b16fe69ed2..6304844d3e5f94 100644 --- a/lib/compat/wordpress-7.0/preload.php +++ b/lib/compat/wordpress-7.0/preload.php @@ -67,10 +67,7 @@ static function ( $template_a, $template_b ) use ( $priorities ) { }; if ( ! empty( $templates ) && ! empty( $templates[0]->content ) ) { - $blocks = parse_blocks( $templates[0]->content ); - if ( function_exists( 'resolve_pattern_blocks' ) ) { - $blocks = resolve_pattern_blocks( $blocks ); - } + $blocks = resolve_pattern_blocks( parse_blocks( $templates[0]->content ) ); $walk_blocks( $blocks ); } From 29102a5042c5fc36733fb1ce634d881de0b09c1e Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Sat, 9 May 2026 08:39:22 -0400 Subject: [PATCH 6/9] Site Editor: align preload assignments --- lib/compat/wordpress-7.0/preload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compat/wordpress-7.0/preload.php b/lib/compat/wordpress-7.0/preload.php index 6304844d3e5f94..d06f0b08f0dc28 100644 --- a/lib/compat/wordpress-7.0/preload.php +++ b/lib/compat/wordpress-7.0/preload.php @@ -11,7 +11,7 @@ function gutenberg_block_editor_preload_paths_6_9( $paths, $context ) { if ( 'core/edit-site' === $context->name ) { $template_slugs = array(); - $front_page = null; + $front_page = null; if ( ! empty( $context->post ) && 'page' === $context->post->post_type ) { $template_slugs[] = empty( $context->post->post_name ) ? 'page' : 'page-' . $context->post->post_name; $template_slugs[] = 'page'; From 808fed483c0ef9001dc43f5d2724292cfba7b836 Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Sun, 10 May 2026 15:37:52 -0400 Subject: [PATCH 7/9] Site Editor: Address preload review feedback --- lib/compat/wordpress-7.0/preload.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/compat/wordpress-7.0/preload.php b/lib/compat/wordpress-7.0/preload.php index d06f0b08f0dc28..d66b8f532d80c2 100644 --- a/lib/compat/wordpress-7.0/preload.php +++ b/lib/compat/wordpress-7.0/preload.php @@ -18,8 +18,9 @@ function gutenberg_block_editor_preload_paths_6_9( $paths, $context ) { } else { $template_slugs[] = 'front-page'; - if ( 'page' === get_option( 'show_on_front' ) ) { - $front_page = get_post( (int) get_option( 'page_on_front' ) ); + $page_on_front = (int) get_option( 'page_on_front' ); + if ( 'page' === get_option( 'show_on_front' ) && $page_on_front > 0 ) { + $front_page = get_post( $page_on_front ); if ( $front_page instanceof WP_Post ) { $template_slugs[] = empty( $front_page->post_name ) ? 'page' : 'page-' . $front_page->post_name; $template_slugs[] = 'page'; @@ -49,7 +50,7 @@ static function ( $template_a, $template_b ) use ( $priorities ) { $template_part_ids = array(); $has_query = false; - $walk_blocks = static function ( $blocks ) use ( &$walk_blocks, &$template_part_ids, &$has_query ) { + $walk_blocks = static function ( array $blocks ) use ( &$walk_blocks, &$template_part_ids, &$has_query ) { foreach ( $blocks as $block ) { if ( 'core/template-part' === ( $block['blockName'] ?? '' ) && ! empty( $block['attrs']['slug'] ) ) { $theme = ! empty( $block['attrs']['theme'] ) ? $block['attrs']['theme'] : get_stylesheet(); From dd5ed0722328c4fcb411fc55f8ac8a686a963502 Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Mon, 11 May 2026 16:01:48 -0400 Subject: [PATCH 8/9] Site Editor: preload additional metadata --- lib/compat/wordpress-7.0/preload.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/compat/wordpress-7.0/preload.php b/lib/compat/wordpress-7.0/preload.php index d66b8f532d80c2..dfec08732bf7fc 100644 --- a/lib/compat/wordpress-7.0/preload.php +++ b/lib/compat/wordpress-7.0/preload.php @@ -91,6 +91,7 @@ static function ( $template_a, $template_b ) use ( $priorities ) { if ( $has_query ) { $post_rest_route = rest_get_route_for_post_type_items( 'post' ); + $paths[] = '/wp/v2/types/post?context=edit'; foreach ( array( 10, 3 ) as $per_page ) { $paths[] = add_query_arg( array( @@ -106,6 +107,17 @@ static function ( $template_a, $template_b ) use ( $priorities ) { } } + $paths[] = add_query_arg( + array( + 'context' => 'edit', + 'per_page' => 100, + '_fields' => 'id,link,menu_order,parent,title,type', + 'orderby' => 'menu_order', + 'order' => 'asc', + ), + rest_get_route_for_post_type_items( 'page' ) + ); + $paths[] = '/wp/v2/taxonomies?context=view'; // Only prefetch for the root. If we preload it for all pages and it's not used From 726564a207bfd3e22d2627ebd6e58bb1be4be7a0 Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Thu, 21 May 2026 12:38:14 -0400 Subject: [PATCH 9/9] Site Editor: move preload changes to 7.1 --- backport-changelog/{7.0 => 7.1}/11766.md | 0 lib/compat/wordpress-7.0/preload.php | 110 ----------------- lib/compat/wordpress-7.1/preload.php | 149 +++++++++++++++++++++++ lib/load.php | 1 + 4 files changed, 150 insertions(+), 110 deletions(-) rename backport-changelog/{7.0 => 7.1}/11766.md (100%) create mode 100644 lib/compat/wordpress-7.1/preload.php diff --git a/backport-changelog/7.0/11766.md b/backport-changelog/7.1/11766.md similarity index 100% rename from backport-changelog/7.0/11766.md rename to backport-changelog/7.1/11766.md diff --git a/lib/compat/wordpress-7.0/preload.php b/lib/compat/wordpress-7.0/preload.php index dfec08732bf7fc..49318230eb0810 100644 --- a/lib/compat/wordpress-7.0/preload.php +++ b/lib/compat/wordpress-7.0/preload.php @@ -10,116 +10,6 @@ */ function gutenberg_block_editor_preload_paths_6_9( $paths, $context ) { if ( 'core/edit-site' === $context->name ) { - $template_slugs = array(); - $front_page = null; - if ( ! empty( $context->post ) && 'page' === $context->post->post_type ) { - $template_slugs[] = empty( $context->post->post_name ) ? 'page' : 'page-' . $context->post->post_name; - $template_slugs[] = 'page'; - } else { - $template_slugs[] = 'front-page'; - - $page_on_front = (int) get_option( 'page_on_front' ); - if ( 'page' === get_option( 'show_on_front' ) && $page_on_front > 0 ) { - $front_page = get_post( $page_on_front ); - if ( $front_page instanceof WP_Post ) { - $template_slugs[] = empty( $front_page->post_name ) ? 'page' : 'page-' . $front_page->post_name; - $template_slugs[] = 'page'; - } - } else { - $template_slugs[] = 'home'; - } - - $template_slugs[] = 'index'; - } - - $template_slugs = array_values( array_unique( $template_slugs ) ); - $templates = get_block_templates( - array( - 'slug__in' => $template_slugs, - ), - 'wp_template' - ); - $priorities = array_flip( $template_slugs ); - - usort( - $templates, - static function ( $template_a, $template_b ) use ( $priorities ) { - return ( $priorities[ $template_a->slug ] ?? 999 ) - ( $priorities[ $template_b->slug ] ?? 999 ); - } - ); - - $template_part_ids = array(); - $has_query = false; - $walk_blocks = static function ( array $blocks ) use ( &$walk_blocks, &$template_part_ids, &$has_query ) { - foreach ( $blocks as $block ) { - if ( 'core/template-part' === ( $block['blockName'] ?? '' ) && ! empty( $block['attrs']['slug'] ) ) { - $theme = ! empty( $block['attrs']['theme'] ) ? $block['attrs']['theme'] : get_stylesheet(); - $template_part_ids[] = $theme . '//' . $block['attrs']['slug']; - } - - if ( 'core/query' === ( $block['blockName'] ?? '' ) ) { - $has_query = true; - } - - if ( ! empty( $block['innerBlocks'] ) ) { - $walk_blocks( $block['innerBlocks'] ); - } - } - }; - - if ( ! empty( $templates ) && ! empty( $templates[0]->content ) ) { - $blocks = resolve_pattern_blocks( parse_blocks( $templates[0]->content ) ); - $walk_blocks( $blocks ); - } - - foreach ( array_unique( $template_part_ids ) as $template_part_id ) { - $paths[] = '/wp/v2/template-parts/' . $template_part_id . '?context=edit'; - } - - if ( $front_page instanceof WP_Post ) { - $route_for_front_page = rest_get_route_for_post( $front_page ); - if ( $route_for_front_page ) { - $paths[] = add_query_arg( 'context', 'edit', $route_for_front_page ); - } - $paths[] = add_query_arg( - 'slug', - empty( $front_page->post_name ) ? 'page' : 'page-' . $front_page->post_name, - '/wp/v2/templates/lookup' - ); - $paths[] = '/wp/v2/types/page?context=edit'; - } - - if ( $has_query ) { - $post_rest_route = rest_get_route_for_post_type_items( 'post' ); - $paths[] = '/wp/v2/types/post?context=edit'; - foreach ( array( 10, 3 ) as $per_page ) { - $paths[] = add_query_arg( - array( - 'context' => 'edit', - 'offset' => 0, - 'order' => 'desc', - 'orderby' => 'date', - 'per_page' => $per_page, - 'ignore_sticky' => 'false', - ), - $post_rest_route - ); - } - } - - $paths[] = add_query_arg( - array( - 'context' => 'edit', - 'per_page' => 100, - '_fields' => 'id,link,menu_order,parent,title,type', - 'orderby' => 'menu_order', - 'order' => 'asc', - ), - rest_get_route_for_post_type_items( 'page' ) - ); - - $paths[] = '/wp/v2/taxonomies?context=view'; - // Only prefetch for the root. If we preload it for all pages and it's not used // it won't be possible to invalidate. // To do: perhaps purge all preloaded paths when client side navigating. diff --git a/lib/compat/wordpress-7.1/preload.php b/lib/compat/wordpress-7.1/preload.php new file mode 100644 index 00000000000000..ef6d6589a47790 --- /dev/null +++ b/lib/compat/wordpress-7.1/preload.php @@ -0,0 +1,149 @@ +name ) { + return $paths; + } + + $template_slugs = array(); + $front_page = null; + if ( ! empty( $context->post ) && 'page' === $context->post->post_type ) { + $template_slugs[] = empty( $context->post->post_name ) ? 'page' : 'page-' . $context->post->post_name; + $template_slugs[] = 'page'; + } else { + $template_slugs[] = 'front-page'; + + $page_on_front = (int) get_option( 'page_on_front' ); + if ( 'page' === get_option( 'show_on_front' ) && $page_on_front > 0 ) { + $front_page = get_post( $page_on_front ); + if ( $front_page instanceof WP_Post ) { + $template_slugs[] = empty( $front_page->post_name ) ? 'page' : 'page-' . $front_page->post_name; + $template_slugs[] = 'page'; + } + } else { + $template_slugs[] = 'home'; + } + + $template_slugs[] = 'index'; + } + + $template_slugs = array_values( array_unique( $template_slugs ) ); + $templates = get_block_templates( + array( + 'slug__in' => $template_slugs, + ), + 'wp_template' + ); + $priorities = array_flip( $template_slugs ); + + usort( + $templates, + static function ( $template_a, $template_b ) use ( $priorities ) { + return ( $priorities[ $template_a->slug ] ?? 999 ) - ( $priorities[ $template_b->slug ] ?? 999 ); + } + ); + + $template_part_ids = array(); + $has_query = false; + + if ( ! empty( $templates ) && ! empty( $templates[0]->content ) ) { + $blocks = gutenberg_resolve_pattern_blocks( parse_blocks( $templates[0]->content ) ); + if ( class_exists( 'WP_Block_Processor' ) ) { + $processor = new WP_Block_Processor( serialize_blocks( $blocks ) ); + while ( $processor->next_block() ) { + if ( $processor->is_block_type( 'core/query' ) ) { + $has_query = true; + } + + if ( ! $processor->is_block_type( 'core/template-part' ) ) { + continue; + } + + $attrs = $processor->allocate_and_return_parsed_attributes(); + if ( ! is_array( $attrs ) || empty( $attrs['slug'] ) ) { + continue; + } + + $theme = ! empty( $attrs['theme'] ) ? $attrs['theme'] : get_stylesheet(); + $template_part_ids[] = $theme . '//' . $attrs['slug']; + } + } else { + $walk_blocks = static function ( array $blocks_to_walk ) use ( &$walk_blocks, &$template_part_ids, &$has_query ) { + foreach ( $blocks_to_walk as $block ) { + if ( 'core/template-part' === ( $block['blockName'] ?? '' ) && ! empty( $block['attrs']['slug'] ) ) { + $theme = ! empty( $block['attrs']['theme'] ) ? $block['attrs']['theme'] : get_stylesheet(); + $template_part_ids[] = $theme . '//' . $block['attrs']['slug']; + } + + if ( 'core/query' === ( $block['blockName'] ?? '' ) ) { + $has_query = true; + } + + if ( ! empty( $block['innerBlocks'] ) ) { + $walk_blocks( $block['innerBlocks'] ); + } + } + }; + $walk_blocks( $blocks ); + } + } + + foreach ( array_unique( $template_part_ids ) as $template_part_id ) { + $paths[] = '/wp/v2/template-parts/' . $template_part_id . '?context=edit'; + } + + if ( $front_page instanceof WP_Post ) { + $route_for_front_page = rest_get_route_for_post( $front_page ); + if ( $route_for_front_page ) { + $paths[] = add_query_arg( 'context', 'edit', $route_for_front_page ); + } + $paths[] = add_query_arg( + 'slug', + empty( $front_page->post_name ) ? 'page' : 'page-' . $front_page->post_name, + '/wp/v2/templates/lookup' + ); + $paths[] = '/wp/v2/types/page?context=edit'; + } + + if ( $has_query ) { + $post_rest_route = rest_get_route_for_post_type_items( 'post' ); + $paths[] = '/wp/v2/types/post?context=edit'; + foreach ( array( 10, 3 ) as $per_page ) { + $paths[] = add_query_arg( + array( + 'context' => 'edit', + 'offset' => 0, + 'order' => 'desc', + 'orderby' => 'date', + 'per_page' => $per_page, + 'ignore_sticky' => 'false', + ), + $post_rest_route + ); + } + } + + $paths[] = add_query_arg( + array( + 'context' => 'edit', + 'per_page' => 100, + '_fields' => 'id,link,menu_order,parent,title,type', + 'orderby' => 'menu_order', + 'order' => 'asc', + ), + rest_get_route_for_post_type_items( 'page' ) + ); + + $paths[] = '/wp/v2/taxonomies?context=view'; + + return $paths; +} +add_filter( 'block_editor_rest_api_preload_paths', 'gutenberg_block_editor_preload_paths_7_1', 10, 2 ); diff --git a/lib/load.php b/lib/load.php index 17204b90b6ec79..e94561990baaa2 100644 --- a/lib/load.php +++ b/lib/load.php @@ -124,6 +124,7 @@ function gutenberg_is_experiment_enabled( $name ) { // WordPress 7.1 compat. require __DIR__ . '/compat/wordpress-7.1/classic-block.php'; +require __DIR__ . '/compat/wordpress-7.1/preload.php'; // Experimental features. require __DIR__ . '/experimental/block-editor-settings-mobile.php';