WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 4 months ago

#41441 closed defect (bug) (fixed)

Deleting a theme from a single site's Themes screen should not be allowed

Reported by: johnbillion Owned by: johnbillion
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch
Focuses: administration, multisite Cc:

Description

With Multisite enabled, it's not possible to delete a plugin from the Plugins screen in individual sites' dashboards. The Delete link is removed.

The same should be true for themes. Currently, a Delete button is shown when a super admin views the Themes screen on an individual site.

Attachments (2)

41441.patch (845 bytes) - added by Mista-Flo 21 months ago.
41441.diff (1.1 KB) - added by johnbillion 4 months ago.

Download all attachments as: .zip

Change History (7)

#1 @williampatton
22 months ago

  • Keywords needs-screenshots added

To me this seems like a good quality of life change and also a good idea to make behaviour between theme and plugin handling of this the same.

@Mista-Flo
21 months ago

#2 @Mista-Flo
21 months ago

  • Keywords has-patch added; needs-patch removed

I have added a patch, it's quite simple, just check if we are in multisite or not to display the Delete button.

Also, I do not know if the screenshot is really needed since it would just be two screenshots, one with the button, the other without it.

#3 @johnbillion
4 months ago

  • Keywords needs-screenshots removed
  • Milestone changed from Awaiting Review to 5.6
  • Owner set to johnbillion
  • Status changed from new to reviewing

@johnbillion
4 months ago

#4 @johnbillion
4 months ago

41441.diff is a slightly different approach, it moves the ! is_multisite() logic to the point where the actions are constructed, therefore keeping the theme deletion logic in one place.

#5 @johnbillion
4 months ago

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

In 49011:

Themes: Remove the ability to delete themes from the single site Appearance screen on Multisite installations.

This brings theme deletion inline with plugin deletion and theme and plugin editing, which can only be performed from within Network Admin.

Props Mista-Flo, williampatton, johnbillion

Fixes #41441

Note: See TracTickets for help on using tickets.