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
This commit is contained in:
Andrew Nacin 2012-02-29 07:50:56 +00:00
parent fe736e6ca1
commit c7855fb7bc
1 changed files with 4 additions and 13 deletions

View File

@ -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 ) {
<p><?php echo _n( 'You are about to remove the following theme:', 'You are about to remove the following themes:', $themes_to_delete ); ?></p>
<ul class="ul-disc">
<?php foreach ( $theme_info as $theme )
echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), esc_html( $theme['Name'] ), esc_html( $theme['AuthorName'] ) ), '</li>'; /* translators: 1: theme name, 2: theme author */ ?>
echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), $theme->display('Name'), $theme->display('Author') ), '</li>'; /* translators: 1: theme name, 2: theme author */ ?>
</ul>
<p><?php _e('Are you sure you wish to delete these themes?'); ?></p>
<form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" style="display:inline;">