diff --git a/wp-admin/network/themes.php b/wp-admin/network/themes.php index 48ddc6878..7208db3ba 100644 --- a/wp-admin/network/themes.php +++ b/wp-admin/network/themes.php @@ -110,26 +110,17 @@ if ( $action ) { $themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array(); - if ( isset( $themes[ get_option( 'template' ) ] ) ) - unset( $themes[ get_option( 'template' ) ] ); - if ( isset( $themes[ get_option( 'stylesheet' ) ] ) ) - unset( $themes[ get_option( 'stylesheet' ) ] ); + unset( $themes[ get_option( 'stylesheet' ) ], $themes[ get_option( 'template' ) ] ); if ( empty( $themes ) ) { wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) ); exit; } - $main_theme = get_current_theme(); $files_to_delete = $theme_info = array(); foreach ( $themes as $key => $theme ) { - $data = get_theme_data( WP_CONTENT_DIR . '/themes/' . $theme . '/style.css' ); - if ( $data['Name'] == $main_theme ) { - unset( $themes[$key] ); - } else { - $files_to_delete = array_merge( $files_to_delete, list_files( WP_CONTENT_DIR . "/themes/$theme" ) ); - $theme_info[ $theme ] = $data; - } + $theme_info[ $theme ] = wp_get_theme( $theme ); + $files_to_delete = array_merge( $files_to_delete, list_files( $theme_info[ $theme ]->get_stylesheet_directory() ) ); } if ( empty( $themes ) ) { @@ -155,7 +146,7 @@ if ( $action ) {