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/rest-api/wpRestTemplatesController.php

    r52436 r53417  
    286286                    'post_title'   => 'Home Page Template',
    287287                    'post_content' => file_get_contents( $theme_root_dir . 'block-theme/templates/page-home.html' ),
     288                    'post_excerpt' => 'Description of page home template.',
     289                ),
     290            ),
     291            'template: parent theme deprecated path'      => array(
     292                'theme_dir' => 'themedir1/block-theme-deprecated-path',
     293                'template'  => 'page-home',
     294                'args'      => array(
     295                    'post_name'    => 'page-home',
     296                    'post_title'   => 'Home Page Template',
     297                    'post_content' => file_get_contents( $theme_root_dir . 'block-theme-deprecated-path/block-templates/page-home.html' ),
    288298                    'post_excerpt' => 'Description of page home template.',
    289299                ),
Note: See TracChangeset for help on using the changeset viewer.