Fix: fatal error when page contains edited template or template part (https://github.com/woocommerce/woocommerce-blocks/pull/5558)
This commit is contained in:
parent
a8d979c47b
commit
61afd2b6ce
|
@ -144,7 +144,11 @@ class BlockTemplatesController {
|
|||
return $template;
|
||||
}
|
||||
|
||||
$available_templates = $this->get_block_templates( array( $slug ), $template_type );
|
||||
$available_templates = $this->get_block_templates_from_woocommerce(
|
||||
array( $slug ),
|
||||
$this->get_block_templates_from_db( array( $slug ), $template_type ),
|
||||
$template_type
|
||||
);
|
||||
return ( is_array( $available_templates ) && count( $available_templates ) > 0 )
|
||||
? BlockTemplateUtils::gutenberg_build_template_result_from_file( $available_templates[0], $available_templates[0]->type )
|
||||
: $template;
|
||||
|
|
Loading…
Reference in New Issue