← All changes
|
lib/experimental/class-wp-rest-block-editor-settings-controller.php
+10
-0
23.7.1
→
trunk
View file →
| @@ -398,8 +398,18 @@ | ||
| 398 | 398 | wp_enqueue_style( 'wp-block-library' ); |
| 399 | 399 | wp_enqueue_style( 'wp-format-library' ); |
| 400 | 400 | wp_enqueue_media(); |
| 401 | 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(); | |
| 411 | + | |
| 402 | 412 | do_action( 'enqueue_block_editor_assets' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound |
| 403 | 413 | |
| 404 | 414 | // Never allow old admin styles as a dependency. |
| 405 | 415 | wp_deregister_style( 'common' ); |