Make WordPress Core

Ticket #54917: 54917.2.diff

File 54917.2.diff, 1.0 KB (added by kapilpaul, 3 years ago)

updated patch

  • src/wp-includes/block-template.php

    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() { 
    4646 * @return string The path to the Full Site Editing template canvas file, or the fallback PHP template.
    4747 */
    4848function locate_block_template( $template, $type, array $templates ) {
     49        if ( ! current_theme_supports( 'block-templates' ) ) {
     50                return $template;
     51        }
     52
    4953        global $_wp_current_template_content;
    5054
    5155        if ( $template ) {
  • tests/phpunit/tests/block-template.php

    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 { 
    1818        public function set_up() {
    1919                parent::set_up();
    2020                switch_theme( 'block-theme' );
     21                do_action( 'setup_theme' );
    2122        }
    2223
    2324        public function tear_down() {