equal
deleted
inserted
replaced
13 |
13 |
14 // Flag that we're loading the block editor. |
14 // Flag that we're loading the block editor. |
15 $current_screen = get_current_screen(); |
15 $current_screen = get_current_screen(); |
16 $current_screen->is_block_editor( true ); |
16 $current_screen->is_block_editor( true ); |
17 |
17 |
18 $block_editor_context = new WP_Block_Editor_Context(); |
18 $block_editor_context = new WP_Block_Editor_Context( array( 'name' => 'core/edit-widgets' ) ); |
19 |
19 |
20 $preload_paths = array( |
20 $preload_paths = array( |
21 array( '/wp/v2/media', 'OPTIONS' ), |
21 array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ), |
|
22 '/wp/v2/widget-types?context=edit&per_page=-1', |
22 '/wp/v2/sidebars?context=edit&per_page=-1', |
23 '/wp/v2/sidebars?context=edit&per_page=-1', |
23 '/wp/v2/widgets?context=edit&per_page=-1&_embed=about', |
24 '/wp/v2/widgets?context=edit&per_page=-1&_embed=about', |
24 ); |
25 ); |
25 block_editor_rest_api_preload( $preload_paths, $block_editor_context ); |
26 block_editor_rest_api_preload( $preload_paths, $block_editor_context ); |
26 |
27 |