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/site-editor.php

    r57543 r58904  
    9292    '/wp/v2/types?context=view',
    9393    '/wp/v2/types/wp_template?context=edit',
    94     '/wp/v2/types/wp_template-part?context=edit',
     94    '/wp/v2/types/wp_template_part?context=edit',
    9595    '/wp/v2/templates?context=edit&per_page=-1',
    9696    '/wp/v2/template-parts?context=edit&per_page=-1',
Note: See TracChangeset for help on using the changeset viewer.