Make WordPress Core


Ignore:
Timestamp:
09/14/2019 04:46:26 PM (7 years ago)
Author:
jorgefilipecosta
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-blocks.php

    r45932 r46110  
    5050        array( '/wp/v2/media', 'OPTIONS' ),
    5151        array( '/wp/v2/blocks', 'OPTIONS' ),
     52        sprintf( '/wp/v2/%s/%d/autosaves?context=edit', $rest_base, $post->ID ),
    5253);
    5354
Note: See TracChangeset for help on using the changeset viewer.