From 6c43311037e39005ded6aa7ca736c81e67fc4150 Mon Sep 17 00:00:00 2001 From: Darren Ethier Date: Fri, 10 Nov 2023 14:23:18 -0500 Subject: [PATCH] Expose serialized template content on WP_Block_Template. When building the template, initialize WP_Block_Template with the serialized block content so callbacks registered to the `hooked_block_types` filter can access the content. --- src/wp-includes/block-template-utils.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/block-template-utils.php b/src/wp-includes/block-template-utils.php index a4e54432d2aa2..73861ec0ac1fc 100644 --- a/src/wp-includes/block-template-utils.php +++ b/src/wp-includes/block-template-utils.php @@ -532,6 +532,7 @@ function _build_block_template_result_from_file( $template_file, $template_type $template->has_theme_file = true; $template->is_custom = true; $template->modified = null; + $template->content = $template_content; if ( 'wp_template' === $template_type && isset( $default_template_types[ $template_file['slug'] ] ) ) { $template->description = $default_template_types[ $template_file['slug'] ]['description'];