Skip to content

Commit

Permalink
Update preload paths for post, site and widgets editors
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Apr 7, 2022
1 parent 86c6fb2 commit 030ab45
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/wp-admin/edit-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ static function( $classes ) {

// Preload common data.
$preload_paths = array(
'/wp/v2/types?context=edit',
'/wp/v2/taxonomies?context=edit',
'/wp/v2/themes?status=active',
'/wp/v2/types?context=view',
'/wp/v2/taxonomies?context=view',
add_query_arg( array( 'context' => 'edit', 'per_page' => -1 ), rest_get_route_for_post_type_items( 'wp_block' ) ),
add_query_arg( 'context', 'edit', $rest_path ),
sprintf( '/wp/v2/types/%s?context=edit', $post_type ),
'/wp/v2/users/me',
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' ),
sprintf( '%s/autosaves?context=edit', $rest_path ),
'/wp/v2/settings',
Expand Down
8 changes: 1 addition & 7 deletions src/wp-admin/site-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,11 @@ static function( $classes ) {
$active_theme = wp_get_theme()->get_stylesheet();
$preload_paths = array(
array( '/wp/v2/media', 'OPTIONS' ),
'/wp/v2/types?context=edit',
'/wp/v2/types?context=view',
'/wp/v2/types/wp_template?context=edit',
'/wp/v2/types/wp_template-part?context=edit',
'/wp/v2/taxonomies?context=edit',
'/wp/v2/pages?context=edit',
'/wp/v2/categories?context=edit',
'/wp/v2/posts?context=edit',
'/wp/v2/tags?context=edit',
'/wp/v2/templates?context=edit&per_page=-1',
'/wp/v2/template-parts?context=edit&per_page=-1',
'/wp/v2/settings',
'/wp/v2/themes?context=edit&status=active',
'/wp/v2/global-styles/' . $active_global_styles_id . '?context=edit',
'/wp/v2/global-styles/' . $active_global_styles_id,
Expand Down
1 change: 1 addition & 0 deletions src/wp-admin/widgets-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

$preload_paths = array(
array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ),
'/wp/v2/widget-types?context=edit&per_page=-1',
'/wp/v2/sidebars?context=edit&per_page=-1',
'/wp/v2/widgets?context=edit&per_page=-1&_embed=about',
);
Expand Down

0 comments on commit 030ab45

Please sign in to comment.