Skip to content

Commit

Permalink
Editor: Update REST API preloaded paths for 6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Mar 3, 2025
1 parent b5e0c16 commit 1b9b6c3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/wp-admin/edit-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,28 @@ static function ( $classes ) {
* Please ensure that the equivalent check is kept in sync with this preload path.
*/
'/wp/v2/global-styles/' . WP_Theme_JSON_Resolver::get_user_global_styles_post_id() . '?context=' . $global_styles_endpoint_context,
// Used by getBlockPatternCategories in useBlockEditorSettings.
'/wp/v2/block-patterns/categories',
// @see packages/core-data/src/entities.js
'/?_fields=' . implode(
',',
array(
'description',
'gmt_offset',
'home',
'name',
'site_icon',
'site_icon_url',
'site_logo',
'timezone_string',
'default_template_part_areas',
'default_template_types',
'url',
'page_for_posts',
'page_on_front',
'show_on_front',
)
),
);

block_editor_rest_api_preload( $preload_paths, $block_editor_context );
Expand Down
26 changes: 26 additions & 0 deletions src/wp-admin/site-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,32 @@ static function ( $classes ) {
),
'GET',
),
'/wp/v2/settings',
array( '/wp/v2/settings', 'OPTIONS' ),
'/wp/v2/templates/lookup?slug=front-page',
'/wp/v2/templates/lookup?slug=home',
// Used by getBlockPatternCategories in useBlockEditorSettings.
'/wp/v2/block-patterns/categories',
// @see packages/core-data/src/entities.js
'/?_fields=' . implode(
',',
array(
'description',
'gmt_offset',
'home',
'name',
'site_icon',
'site_icon_url',
'site_logo',
'timezone_string',
'default_template_part_areas',
'default_template_types',
'url',
'page_for_posts',
'page_on_front',
'show_on_front',
)
),
);

block_editor_rest_api_preload( $preload_paths, $block_editor_context );
Expand Down

0 comments on commit 1b9b6c3

Please sign in to comment.