Make WordPress Core


Ignore:
Timestamp:
04/07/2022 01:38:08 PM (3 years ago)
Author:
gziolo
Message:

Editor: Update preload paths for post, site and widgets editors

Changes the REST endpoints that get preloaded when displaying a page for post, site and widgets editor, so that they are in sync with what the latest version of Gutenberg to be shipped with Core 6.0 really requests.

Props jsnajdr.
See #55505.

File:
1 edited

Legend:

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

    r53070 r53094  
    5858// Preload common data.
    5959$preload_paths = array(
    60     '/wp/v2/types?context=edit',
    61     '/wp/v2/taxonomies?context=edit',
    62     '/wp/v2/themes?status=active',
     60    '/wp/v2/types?context=view',
     61    '/wp/v2/taxonomies?context=view',
     62    add_query_arg(
     63        array(
     64            'context' => 'edit',
     65            'per_page' => -1,
     66        ),
     67        rest_get_route_for_post_type_items( 'wp_block' )
     68    ),
    6369    add_query_arg( 'context', 'edit', $rest_path ),
    6470    sprintf( '/wp/v2/types/%s?context=edit', $post_type ),
    6571    '/wp/v2/users/me',
    6672    array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ),
     73    array( rest_get_route_for_post_type_items( 'page' ), 'OPTIONS' ),
    6774    array( rest_get_route_for_post_type_items( 'wp_block' ), 'OPTIONS' ),
    6875    sprintf( '%s/autosaves?context=edit', $rest_path ),
Note: See TracChangeset for help on using the changeset viewer.