← All changes
|
lib/experimental/class-wp-rest-block-editor-settings-controller.php
+11
-2
23.4.0
→
trunk
View file →
| @@ -351,10 +351,9 @@ | ||
| 351 | 351 | // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited |
| 352 | 352 | $hook_suffix = 'block-editor-assets'; |
| 353 | 353 | |
| 354 | 354 | // Remove unwanted scripts/styles. |
| 355 | - remove_action( 'admin_enqueue_scripts', 'gutenberg_enqueue_command_palette_assets', 9 ); | |
| 356 | - remove_action( 'admin_enqueue_scripts', 'gutenberg_enqueue_command_palette_assets' ); | |
| 355 | + remove_action( 'admin_enqueue_scripts', 'wp_enqueue_command_palette_assets' ); | |
| 357 | 356 | remove_action( 'admin_enqueue_scripts', 'wp_auth_check_load' ); |
| 358 | 357 | remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); |
| 359 | 358 | remove_action( 'admin_print_styles', 'print_emoji_styles' ); |
| 360 | 359 | |
| @@ -398,8 +397,18 @@ | ||
| 398 | 397 | wp_enqueue_style( 'wp-editor' ); |
| 399 | 398 | wp_enqueue_style( 'wp-block-library' ); |
| 400 | 399 | wp_enqueue_style( 'wp-format-library' ); |
| 401 | 400 | wp_enqueue_media(); |
| 401 | + | |
| 402 | + /* | |
| 403 | + * Block style variations provided by the theme's theme.json | |
| 404 | + * partials are registered lazily, when the theme JSON resolver | |
| 405 | + * first runs in a request. Nothing has run it in this REST | |
| 406 | + * request yet, so prime it — otherwise the block styles registry | |
| 407 | + * is still empty when `enqueue_editor_block_styles_assets()` | |
| 408 | + * serializes it into the `wp-block-styles` inline script below. | |
| 409 | + */ | |
| 410 | + WP_Theme_JSON_Resolver_Gutenberg::get_theme_data(); | |
| 402 | 411 | |
| 403 | 412 | do_action( 'enqueue_block_editor_assets' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound |
| 404 | 413 | |
| 405 | 414 | // Never allow old admin styles as a dependency. |