This commit is contained in:
Albert Juhé Lluveras 2023-02-28 15:16:49 +01:00 committed by GitHub
parent a57ab52702
commit 29d4f6f07a
1 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,7 @@
namespace Automattic\WooCommerce\Blocks;
use Automattic\WooCommerce\Blocks\Domain\Package;
use Automattic\WooCommerce\Blocks\Templates\BlockTemplatesCompatibility;
use Automattic\WooCommerce\Blocks\Templates\ProductAttributeTemplate;
use Automattic\WooCommerce\Blocks\Utils\BlockTemplateUtils;
@ -324,6 +325,14 @@ class BlockTemplatesController {
$template->description = BlockTemplateUtils::get_block_template_description( $template->slug );
}
if ( 'single-product' === $template->slug ) {
if ( ! is_admin() ) {
$new_content = BlockTemplatesCompatibility::wrap_single_product_template( $template->content );
$template->content = $new_content;
}
return $template;
}
return $template;
},
$query_result