Make WordPress Core


Ignore:
Timestamp:
05/20/2022 12:47:45 AM (3 years ago)
Author:
peterwilsoncc
Message:

Themes: Accept valid block themes.

Updates theme validation to accept block themes. This replaces the requirement for an index.php with a requirement for either an index.php, /templates/index.html or the deprecated /block-templates/index.html.

Validation is updated for theme uploads, within WP_Theme::__construct and validate_current_theme().

A block theme using the deprecated file structure is now included in the unit tests.

Props peterwilsoncc, sergeybiryukov, hellofromtonya, costdev, azaozz, gziolo, FlorianBrinkmann, Boniu91, aristath, poena, audrasjb.
Fixes #55754.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme.php

    r53254 r53416  
    342342            $theme_path     = $this->theme_root . '/' . $this->stylesheet;
    343343
    344             if ( ! file_exists( $theme_path . '/templates/index.html' )
     344            if (
     345                ! file_exists( $theme_path . '/templates/index.html' )
     346                && ! file_exists( $theme_path . '/block-templates/index.html' ) // Deprecated path support since 5.9.0.
    345347                && ! file_exists( $theme_path . '/index.php' )
    346348            ) {
Note: See TracChangeset for help on using the changeset viewer.