diff --git a/src/wp-includes/block-editor.php b/src/wp-includes/block-editor.php
index aaa249cb7b..13445af745 100644
a
|
b
|
function block_editor_rest_api_preload( array $preload_paths, $block_editor_cont |
468 | 468 | */ |
469 | 469 | $backup_global_post = ! empty( $post ) ? clone $post : $post; |
470 | 470 | |
| 471 | foreach ( $preload_paths as &$path ) { |
| 472 | if ( is_string( $path ) && ! str_starts_with( $path, '/' ) ) { |
| 473 | $path = '/' . $path; |
| 474 | } |
| 475 | |
| 476 | if ( is_array( $path ) ) { |
| 477 | foreach( $path as &$part ) { |
| 478 | if ( is_string( $part ) |
| 479 | && $path === strtolower( $part ) |
| 480 | && ! str_starts_with( $part ) ) { |
| 481 | $part = '/' . $part; |
| 482 | } |
| 483 | } |
| 484 | } |
| 485 | } |
| 486 | |
471 | 487 | $preload_data = array_reduce( |
472 | 488 | $preload_paths, |
473 | 489 | 'rest_preload_api_request', |