Compatibility Layer - Return raw content without hooks if the content is empty (https://github.com/woocommerce/woocommerce-blocks/pull/10453)

This commit is contained in:
Karol Manijak 2023-08-03 11:01:46 +02:00 committed by GitHub
parent 84f4cec592
commit d5d5a36f56
1 changed files with 4 additions and 0 deletions

View File

@ -144,6 +144,10 @@ class ArchiveProductTemplatesCompatibility extends AbstractTemplateCompatibility
return $content;
}
if ( empty( $block_content ) ) {
return $block_content;
}
return sprintf(
'%1$s%2$s%3$s',
$this->get_hooks_buffer( $block_hooks, 'before' ),