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
This commit is contained in:
Jorge Costa 2019-09-14 16:46:26 +00:00
parent e4e1c7380c
commit 31a2e8af87
1 changed files with 1 additions and 0 deletions

View File

@ -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 ),
);
/**