From 74688add2ceefb87bd3bf1595be139af536a7ed1 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 20 Sep 2020 12:01:32 +0000 Subject: [PATCH] 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 git-svn-id: https://develop.svn.wordpress.org/trunk@49011 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index 21730339cd..84b13c58f7 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/wp-admin/includes/theme.php @@ -748,7 +748,7 @@ function wp_prepare_themes_for_js( $themes = null ) { 'actions' => array( 'activate' => current_user_can( 'switch_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=activate&stylesheet=' . $encoded_slug ), 'switch-theme_' . $slug ) : null, 'customize' => $customize_action, - 'delete' => current_user_can( 'delete_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null, + 'delete' => ( ! is_multisite() && current_user_can( 'delete_themes' ) ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null, 'autoupdate' => wp_is_auto_update_enabled_for_type( 'theme' ) && ! is_multisite() && current_user_can( 'update_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=' . $auto_update_action . '&stylesheet=' . $encoded_slug ), 'updates' ) : null,