From c7855fb7bc33156aae9406db303cc2e0c8ec6adc Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 29 Feb 2012 07:50:56 +0000 Subject: [PATCH] Use wp_get_theme() rather than get_theme_data() in the verify theme deletion (multisite network) screen. see #20103. git-svn-id: https://develop.svn.wordpress.org/trunk@20037 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/network/themes.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/wp-admin/network/themes.php b/wp-admin/network/themes.php index 48ddc6878f..7208db3bad 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 ) {