From 9f9fbc64f3c3a7288ecff47a6675b4d470fd645a Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 6 Sep 2022 16:16:07 +0000 Subject: [PATCH] Block Editor: Preload settings and templates permissions. This is a path for following changes in the Gutenberg plugin: * [https://github.com/WordPress/gutenberg/pull/42209 #42209: Post Editor: Preload templates post type permissions] * [https://github.com/WordPress/gutenberg/pull/42413 #42413: Post Editor: Avoid 403 errors for users with low permissions]. Follow-up to [43815], [44172], [46110], [51962], [52995]. Props Mamaduka, bernhard-reiter, TimothyBlynJacobs. See #56467. git-svn-id: https://develop.svn.wordpress.org/trunk@54084 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-form-blocks.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index a842facd4970a..8b07908d61190 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -68,8 +68,10 @@ static function( $classes ) { array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ), array( rest_get_route_for_post_type_items( 'page' ), 'OPTIONS' ), array( rest_get_route_for_post_type_items( 'wp_block' ), 'OPTIONS' ), + array( rest_get_route_for_post_type_items( 'wp_template' ), 'OPTIONS' ), sprintf( '%s/autosaves?context=edit', $rest_path ), '/wp/v2/settings', + array( '/wp/v2/settings', 'OPTIONS' ), ); block_editor_rest_api_preload( $preload_paths, $block_editor_context );