Skip to content

Commit

Permalink
Update block theme conditionals in BlockTemplateController (woocommer…
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcafferkey authored and jonny-bull committed Dec 14, 2021
1 parent 7bbce4f commit 82bf6df
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/BlockTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ public function get_single_block_template( $template, $id, $template_type ) {
* @return array
*/
public function add_block_templates( $query_result, $query, $template_type ) {
if ( ! function_exists( 'gutenberg_supports_block_templates' ) || ! gutenberg_supports_block_templates() ) {
if (
( ! function_exists( 'wp_is_block_theme' ) || ! wp_is_block_theme() ) &&
( ! function_exists( 'gutenberg_supports_block_templates' ) || ! gutenberg_supports_block_templates() )
) {
return $query_result;
}

Expand Down Expand Up @@ -406,7 +409,11 @@ public function block_template_is_available( $template_name, $template_type = 'w
* Renders the default block template from Woo Blocks if no theme templates exist.
*/
public function render_block_template() {
if ( is_embed() || ! function_exists( 'gutenberg_supports_block_templates' ) || ! gutenberg_supports_block_templates() ) {
if (
is_embed() ||
( ! function_exists( 'wp_is_block_theme' ) || ! wp_is_block_theme() ) &&
( ! function_exists( 'gutenberg_supports_block_templates' ) || ! gutenberg_supports_block_templates() )
) {
return;
}

Expand Down

0 comments on commit 82bf6df

Please sign in to comment.