Make WordPress Core


Ignore:
Timestamp:
08/16/2024 06:21:43 AM (7 months ago)
Author:
Mamaduka
Message:

Editor: Fix preloaded REST API paths

When providing an incorrect path to preload, the rest_preload_api_request will silently fail, and nothing will be preloaded.

  • Fix typo for wp_template_part post type preload path for the Site Editor.
  • Do not preload the wp_block post type for post editors. The endpoint doesn't support unbound queries, and the data is no longer needed during editor initialization.

Props kirasong, tyxla, mamaduka.
Fixes #61884.

File:
1 edited

Legend:

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

    r58690 r58904  
    5656    '/wp/v2/types?context=view',
    5757    '/wp/v2/taxonomies?context=view',
    58     add_query_arg(
    59         array(
    60             'context'  => 'edit',
    61             'per_page' => -1,
    62         ),
    63         rest_get_route_for_post_type_items( 'wp_block' )
    64     ),
    6558    add_query_arg( 'context', 'edit', $rest_path ),
    6659    sprintf( '/wp/v2/types/%s?context=edit', $post_type ),
Note: See TracChangeset for help on using the changeset viewer.