Skip to content

Commit 13d3c5e

Browse files
committed
Editor: Fix preloaded REST API paths
When providing an incorrect path to preload, the `rest_preload_api_request` will silently fail, and nothing will be preloaded. * Fix typo for `wp_template_part` post type preload path for the Site Editor. * Do not preload the `wp_block` post type for post editors. The endpoint doesn't support unbound queries, and the data is no longer needed during editor initialization. Props kirasong, tyxla, mamaduka. Fixes #61884. git-svn-id: https://develop.svn.wordpress.org/trunk@58904 602fd350-edb4-49c9-b593-d223f7449a82
1 parent aa9fd33 commit 13d3c5e

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/wp-admin/edit-form-blocks.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ static function ( $classes ) {
5555
$preload_paths = array(
5656
'/wp/v2/types?context=view',
5757
'/wp/v2/taxonomies?context=view',
58-
add_query_arg(
59-
array(
60-
'context' => 'edit',
61-
'per_page' => -1,
62-
),
63-
rest_get_route_for_post_type_items( 'wp_block' )
64-
),
6558
add_query_arg( 'context', 'edit', $rest_path ),
6659
sprintf( '/wp/v2/types/%s?context=edit', $post_type ),
6760
'/wp/v2/users/me',

src/wp-admin/site-editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static function ( $classes ) {
9191
array( '/wp/v2/media', 'OPTIONS' ),
9292
'/wp/v2/types?context=view',
9393
'/wp/v2/types/wp_template?context=edit',
94-
'/wp/v2/types/wp_template-part?context=edit',
94+
'/wp/v2/types/wp_template_part?context=edit',
9595
'/wp/v2/templates?context=edit&per_page=-1',
9696
'/wp/v2/template-parts?context=edit&per_page=-1',
9797
'/wp/v2/themes?context=edit&status=active',

0 commit comments

Comments
 (0)