From 31a2e8af87fff95009e3a9619b8f7ee07b90860f Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Sat, 14 Sep 2019 16:46:26 +0000 Subject: [PATCH] Block Editor: Add preloading of autosaves. With the introduction of https://github.com/WordPress/gutenberg/pull/7945, the block editor requests autosave data when the editor is loaded. This can be optimized by preloading the request server-side and then passing the request data to the client using the preloading mechanism in editor-form-blocks.php. Props: talldanwp, aduth. git-svn-id: https://develop.svn.wordpress.org/trunk@46110 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-form-blocks.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index 3fe6463551..e1967dd329 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -49,6 +49,7 @@ $preload_paths = array( sprintf( '/wp/v2/users/me?post_type=%s&context=edit', $post_type ), array( '/wp/v2/media', 'OPTIONS' ), array( '/wp/v2/blocks', 'OPTIONS' ), + sprintf( '/wp/v2/%s/%d/autosaves?context=edit', $rest_base, $post->ID ), ); /**