Skip to content

Commit fe51709

Browse files
committed
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: https://core.svn.wordpress.org/trunk@58380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 2fa2208 commit fe51709

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

wp-admin/site-editor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ static function ( $classes ) {
8888
);
8989

9090
$preload_paths = array(
91-
array( '/wp/v2/media', 'OPTIONS' ),
91+
array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ),
92+
array( rest_get_route_for_post_type_items( 'page' ), 'OPTIONS' ),
9293
'/wp/v2/types?context=view',
9394
'/wp/v2/types/wp_template?context=edit',
9495
'/wp/v2/types/wp_template_part?context=edit',

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.7-alpha-58983';
19+
$wp_version = '6.7-alpha-58984';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)