From bfcd8759462629d0cba32e520eb3599381face4d Mon Sep 17 00:00:00 2001 From: Mamaduka Date: Fri, 16 Aug 2024 06:23:17 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@58904 git-svn-id: http://core.svn.wordpress.org/trunk@58300 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-blocks.php | 7 ------- wp-admin/site-editor.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/wp-admin/edit-form-blocks.php b/wp-admin/edit-form-blocks.php index ecf83f2017..91e4b1e37d 100644 --- a/wp-admin/edit-form-blocks.php +++ b/wp-admin/edit-form-blocks.php @@ -55,13 +55,6 @@ $rest_path = rest_get_route_for_post( $post ); $preload_paths = array( '/wp/v2/types?context=view', '/wp/v2/taxonomies?context=view', - add_query_arg( - array( - 'context' => 'edit', - 'per_page' => -1, - ), - rest_get_route_for_post_type_items( 'wp_block' ) - ), add_query_arg( 'context', 'edit', $rest_path ), sprintf( '/wp/v2/types/%s?context=edit', $post_type ), '/wp/v2/users/me', diff --git a/wp-admin/site-editor.php b/wp-admin/site-editor.php index 70d646ae51..6951d05e55 100644 --- a/wp-admin/site-editor.php +++ b/wp-admin/site-editor.php @@ -91,7 +91,7 @@ $preload_paths = array( array( '/wp/v2/media', 'OPTIONS' ), '/wp/v2/types?context=view', '/wp/v2/types/wp_template?context=edit', - '/wp/v2/types/wp_template-part?context=edit', + '/wp/v2/types/wp_template_part?context=edit', '/wp/v2/templates?context=edit&per_page=-1', '/wp/v2/template-parts?context=edit&per_page=-1', '/wp/v2/themes?context=edit&status=active', diff --git a/wp-includes/version.php b/wp-includes/version.php index 939369c70f..7a2ac0ed20 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58903'; +$wp_version = '6.7-alpha-58904'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.