WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#32854 closed defect (bug) (duplicate)

Uploading a theme via zip file not working if style.css and index.php are in a subdirectory

Reported by: onishiweb Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: Themes Keywords:
Focuses: Cc:

Description

Since 3.4 WordPress themes have been able to use subdirectories for templates (https://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/) and it's working great. We have a theme architecture now that organises all files out of the root into subdirectories, it works fine when the theme is installed via uploading into the /themes directory but not when it's attempted to be uploaded via zip as the installer is only looking for style.css and index.php in the theme root.

Steps to reproduce:

This is slightly related to #24814 which is marked 'won't fix' but has since been changed so would be good for the uploader script to mirror this behaviour as they are now valid themes.

Change History (1)

#1 @dd32
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

The only reason this currently works when you install it directly onto the filesystem is because WordPress allows directories of themes, which allows for external repositories to be used as externals in deployments (I don't know when this was added, but it was a long time ago, before #24814 was created), for example:

themes
 + twentyten
 + wporg-themes
   - theme1
     - style.css
   - theme2
     - style.css
 + github
   - theme3
     - style.css
   - theme4
     - style.css

In the above case, the theme as WordPress see's it, is still the theme[1..4] folders, and will internally be referenced as wporg-themes/theme1.

I still don't think we should change the definition of a theme to allow style.css/index.php in arbitrary subdirectories of the themes folder personally, but you can discuss it on #24814 and potentially re-open it if need be.

Last edited 6 years ago by dd32 (previous) (diff)
Note: See TracTickets for help on using tickets.