Make WordPress Core


Ignore:
Timestamp:
05/20/2022 12:59:55 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.
Merges [53416] to the 6.0 branch.
Fixes #55682.

Location:
branches/6.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.0

  • branches/6.0/tests/phpunit/tests/theme/themeDir.php

    r53282 r53417  
    166166            'Block Theme [0.4.0]',
    167167            'Block Theme [1.0.0] in subdirectory',
     168            'Block Theme Deprecated Path',
    168169            'Webfonts theme',
    169170            'Empty `fontFace` in theme.json - no webfonts defined',
    170171        );
    171172
    172         sort( $theme_names );
    173         sort( $expected );
    174 
    175         $this->assertSame( $expected, $theme_names );
     173        $this->assertSameSets( $expected, $theme_names );
    176174    }
    177175
Note: See TracChangeset for help on using the changeset viewer.