| @@ -4,10 +4,14 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package gutenberg |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -?> | |
| 9 | -<!DOCTYPE html> | |
| 8 | +/** | |
| 9 | + * Get the template HTML. | |
| 10 | + * This needs to run before <head> so that blocks can add scripts and styles in wp_head(). | |
| 11 | + */ | |
| 12 | +$template_html = gutenberg_get_the_template_html(); | |
| 13 | +?><!DOCTYPE html> | |
| 10 | 14 | <html <?php language_attributes(); ?>> |
| 11 | 15 | <head> |
| 12 | 16 | <meta charset="<?php bloginfo( 'charset' ); ?>" /> |
| 13 | 17 | <?php wp_head(); ?> |
| @@ -15,9 +19,9 @@ | ||
| 15 | 19 | |
| 16 | 20 | <body <?php body_class(); ?>> |
| 17 | 21 | <?php wp_body_open(); ?> |
| 18 | 22 | |
| 19 | -<?php gutenberg_render_the_template(); ?> | |
| 23 | +<?php echo $template_html; // phpcs:ignore WordPress.Security.EscapeOutput ?> | |
| 20 | 24 | |
| 21 | 25 | <?php wp_footer(); ?> |
| 22 | 26 | </body> |
| 23 | 27 | </html> |