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
This commit is contained in:
Mamaduka 2024-09-04 04:17:14 +00:00
parent d65e65cd6c
commit 1e6b860630
2 changed files with 3 additions and 2 deletions

View File

@ -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',

View File

@ -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.