Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#15707 closed defect (bug) (fixed)

Theme deletion when running multisite

Reported by: nacin Owned by: PeteMall
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Network Admin Keywords: i18n-change needs-patch
Focuses: multisite Cc:


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)

15707.patch (2.1 KB) - added by ocean90 11 years ago.
15707.2.diff (6.8 KB) - added by PeteMall 11 years ago.

Download all attachments as: .zip

Change History (12)

#1 @flashingcursor
11 years ago

  • Cc flashingcursor added

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...

#2 @PeteMall
11 years ago

  • Owner set to PeteMall
  • Status changed from new to assigned

#3 @automattor
11 years ago

(In [16759]) Don't reference nonexistent tabs. see #15707.

11 years ago

#4 @ocean90
11 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.

#5 @PeteMall
11 years ago

  • Status changed from assigned to accepted

#6 @nacin
11 years ago

How to fix this:

  1. Remove the Delete link from the themes list table if running multisite.
  1. 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.)

#7 @nacin
11 years ago

  • Keywords i18n-change added

#8 @nacin
11 years ago

  • Keywords needs-patch added

11 years ago

#9 @ryan
11 years ago

Seems good. Following up with some esc_url() on all of the actions links might be prudent.

#10 @ryan
11 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [17101]) Add delete support to network themes. Props PeteMall. fixes #15707

Note: See TracTickets for help on using tickets.