From 1e6b860630cf36600636ee7c9952c1ead4a9ddbc Mon Sep 17 00:00:00 2001 From: Mamaduka Date: Wed, 4 Sep 2024 04:17:14 +0000 Subject: [PATCH] Editor: Update preloaded paths for the site editor Add the `OPTIONS /wp/v2/pages` route to the list. The request is made via the `useBlockEditorSettings` hook at the top of the editor React tree. Preloading should improve the editor's loading time. Avoid hardcoding paths for the 'attachment' post type; use the `rest_get_route_for_post_type_items` helper method instead. Props mamaduka, noisysocks. See #61884. Built from https://develop.svn.wordpress.org/trunk@58984 git-svn-id: http://core.svn.wordpress.org/trunk@58380 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/site-editor.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/site-editor.php b/wp-admin/site-editor.php index 6951d05e55..7e2e763dee 100644 --- a/wp-admin/site-editor.php +++ b/wp-admin/site-editor.php @@ -88,7 +88,8 @@ $navigation_rest_route = rest_get_route_for_post_type_items( ); $preload_paths = array( - array( '/wp/v2/media', 'OPTIONS' ), + array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ), + array( rest_get_route_for_post_type_items( 'page' ), 'OPTIONS' ), '/wp/v2/types?context=view', '/wp/v2/types/wp_template?context=edit', '/wp/v2/types/wp_template_part?context=edit', diff --git a/wp-includes/version.php b/wp-includes/version.php index 0fb1852372..50f8507872 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58983'; +$wp_version = '6.7-alpha-58984'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.