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/src/wp-includes/theme.php

    r53053 r53417  
    862862    }
    863863
    864     if ( ! file_exists( get_template_directory() . '/templates/index.html' )
     864    if (
     865        ! file_exists( get_template_directory() . '/templates/index.html' )
     866        && ! file_exists( get_template_directory() . '/block-templates/index.html' ) // Deprecated path support since 5.9.0.
    865867        && ! file_exists( get_template_directory() . '/index.php' )
    866868    ) {
Note: See TracChangeset for help on using the changeset viewer.