diff --git a/src/wp-includes/block-template.php b/src/wp-includes/block-template.php
index de266c04f25..97ab4044ef0 100644
a
|
b
|
function _add_template_loader_filters() { |
46 | 46 | * @return string The path to the Full Site Editing template canvas file, or the fallback PHP template. |
47 | 47 | */ |
48 | 48 | function locate_block_template( $template, $type, array $templates ) { |
| 49 | if ( ! current_theme_supports( 'block-templates' ) ) { |
| 50 | return $template; |
| 51 | } |
| 52 | |
49 | 53 | global $_wp_current_template_content; |
50 | 54 | |
51 | 55 | if ( $template ) { |
diff --git a/tests/phpunit/tests/block-template.php b/tests/phpunit/tests/block-template.php
index 95dab825b98..7163fea70ab 100644
a
|
b
|
class Tests_Block_Template extends WP_UnitTestCase { |
18 | 18 | public function set_up() { |
19 | 19 | parent::set_up(); |
20 | 20 | switch_theme( 'block-theme' ); |
| 21 | do_action( 'setup_theme' ); |
21 | 22 | } |
22 | 23 | |
23 | 24 | public function tear_down() { |