Make WordPress Core

Ticket #58405: 58405-2.diff

File 58405-2.diff, 909 bytes (added by nihar007, 3 years ago)
  • src/wp-includes/class-wp-theme.php

    diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php
    index 3b520782c1..bd16abd16b 100644
    a b final class WP_Theme implements ArrayAccess { 
    360360
    361361                if ( ! $this->template ) {
    362362                        $this->template = $this->stylesheet;
    363                         $theme_path     = $this->theme_root . '/' . $this->stylesheet;
    364363
    365364                        if (
    366                                 ! file_exists( $theme_path . '/templates/index.html' )
    367                                 && ! file_exists( $theme_path . '/block-templates/index.html' ) // Deprecated path support since 5.9.0.
    368                                 && ! file_exists( $theme_path . '/index.php' )
     365                                ! $this->is_block_theme()
     366                                && ! file_exists( $this->theme_root . '/' . $this->stylesheet . '/index.php' )
    369367                        ) {
    370368                                $error_message = sprintf(
    371369                                        /* translators: 1: templates/index.html, 2: index.php, 3: Documentation URL, 4: Template, 5: style.css */