Automattic\WooCommerce\Internal\ComingSoon
ComingSoonRequestHandler::possibly_init_block_templates
Initializes block templates so we can show coming soon page in non-FSE themes.
Method of the class: ComingSoonRequestHandler{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ComingSoonRequestHandler = new ComingSoonRequestHandler(); $ComingSoonRequestHandler->possibly_init_block_templates();
ComingSoonRequestHandler::possibly_init_block_templates() ComingSoonRequestHandler::possibly init block templates code WC 10.6.2
public function possibly_init_block_templates() {
// No need to initialize block templates since we've already initialized them in the Block Bootstrap.
if ( wp_is_block_theme() || current_theme_supports( 'block-template-parts' ) ) {
return;
}
$container = BlocksPackage::container();
$container->get( BlockTemplatesRegistry::class )->init();
$container->get( BlockTemplatesController::class )->init();
}