[wp-trac] [WordPress Trac] #55682: Allow block themes to be uploaded without index.php

WordPress Trac noreply at wordpress.org
Tue May 10 13:51:14 UTC 2022


#55682: Allow block themes to be uploaded without index.php
----------------------------------------+---------------------
 Reporter:  FlorianBrinkmann            |       Owner:  (none)
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  6.0
Component:  Themes                      |     Version:  trunk
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch has-testing-info  |     Focuses:
----------------------------------------+---------------------
Changes (by costdev):

 * keywords:  has-patch => has-patch has-testing-info


Comment:

 == Test Report

 === Environment
 * Server: Apache (Linux)
 * WordPress: 6.1-alpha-53344-src
 * Browser: Chrome 101.0.4951.54
 * OS: Windows 10
 * Theme: Twenty Twenty-Two
 * Plugins: None activated.

 === Steps
 1. Create four theme folders:
  - Just `style.css`.
  - `style.css`, `index.php` and `templates/index.html`.
  - `style.css` and `index.php`.
  - `style.css` and `templates/index.html`.
 2. Zip each folder into its own `.zip` file.
 3. Navigate to `Appearance > Themes > Add New > Upload Theme`.
 4. Attempt to upload each theme.
 5. Delete the uploaded themes.
 6. Apply [https://github.com/WordPress/wordpress-develop/pull/2692 PR
 2692].
 7. Repeat steps 3-4.

 === Results
 1. Before applying [https://github.com/WordPress/wordpress-
 develop/pull/2692 PR 2692]:
  - Just `style.css`. ❌
  - `style.css`, `index.php` and `templates/index.html`. ✅
  - `style.css` and `index.php`. ✅
  - `style.css` and `templates/index.html`. ❌
 2. After applying [https://github.com/WordPress/wordpress-
 develop/pull/2692 PR 2692]:
  - Just `style.css`. ❌
  - `style.css`, `index.php` and `templates/index.html`. ✅
  - `style.css` and `index.php`. ✅
  - `style.css` and `templates/index.html`. ✅

 === Notes/Queries
 1. The PR appears to work as expected.
 2. As a block theme may instead use `block-templates/index.html` for BC
 reasons [https://github.com/WordPress/wordpress-
 develop/blob/3dcdd4b799de1442fa76f3b71b84485362fce83a/src/wp-includes
 /class-wp-theme.php#L1484 ref], should the PR also account for this file?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55682#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list