Opened 2 years ago
Closed 2 years ago
#15707 closed defect (bug) (fixed)
Theme deletion when running multisite
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | Network Admin | Version: | |
| Severity: | normal | Keywords: | i18n-change needs-patch |
| Cc: | flashingcursor |
Description
The delete link should be hidden from the themes list table when running multisite.
But then there's no way to delete a theme.
I think there should be a delete link and action added into the multisite list table. Probably just with a confirmation warning for now that other sites may be using that theme still, even if it is disabled in ms-themes.
I believe a deleted theme will kick them back to WP_DEFAULT_THEME.
Attachments (2)
Change History (12)
comment:1
flashingcursor — 2 years ago
- Cc flashingcursor added
comment:3
automattor — 2 years ago
15707.patch adds a delete link to ms themes with a confirmation warning. The link will be displayed if the theme isn't network enabled.
The big problem, there is no kick back to WP_DEFAULT_THEME. On site admin we have the function validate_current_theme() which checks the current theme.
How to fix this:
- Remove the Delete link from the themes list table if running multisite.
- Add the Delete link to the MS themes list table (patch here), but prevent deletion of the main site's active theme. (Hide the link and add a check in the post handler.)
Seems good. Following up with some esc_url() on all of the actions links might be prudent.
comment:10
ryan — 2 years ago
- Resolution set to fixed
- Status changed from accepted to closed

If you delete it at the site admin level or manually, it does seem to fall back to WP_DEFAULT_THEME, so I imagine the same thing would happen if you deleted @ the net admin level.
Seems to make sense that the network admin would be where this would happen -- and eventually it should check network-wide for active themes.
Also seeing some strangeness with plugins at the Network Admin level, but that'll have to find a home in another ticket...