Use wp_get_theme() rather than get_theme_data() in the verify theme deletion (multisite network) screen. see #20103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a9b4a2fe6c
commit
6321f9060c
|
@ -110,26 +110,17 @@ if ( $action ) {
|
||||||
|
|
||||||
$themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
|
$themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
|
||||||
|
|
||||||
if ( isset( $themes[ get_option( 'template' ) ] ) )
|
unset( $themes[ get_option( 'stylesheet' ) ], $themes[ get_option( 'template' ) ] );
|
||||||
unset( $themes[ get_option( 'template' ) ] );
|
|
||||||
if ( isset( $themes[ get_option( 'stylesheet' ) ] ) )
|
|
||||||
unset( $themes[ get_option( 'stylesheet' ) ] );
|
|
||||||
|
|
||||||
if ( empty( $themes ) ) {
|
if ( empty( $themes ) ) {
|
||||||
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
|
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$main_theme = get_current_theme();
|
|
||||||
$files_to_delete = $theme_info = array();
|
$files_to_delete = $theme_info = array();
|
||||||
foreach ( $themes as $key => $theme ) {
|
foreach ( $themes as $key => $theme ) {
|
||||||
$data = get_theme_data( WP_CONTENT_DIR . '/themes/' . $theme . '/style.css' );
|
$theme_info[ $theme ] = wp_get_theme( $theme );
|
||||||
if ( $data['Name'] == $main_theme ) {
|
$files_to_delete = array_merge( $files_to_delete, list_files( $theme_info[ $theme ]->get_stylesheet_directory() ) );
|
||||||
unset( $themes[$key] );
|
|
||||||
} else {
|
|
||||||
$files_to_delete = array_merge( $files_to_delete, list_files( WP_CONTENT_DIR . "/themes/$theme" ) );
|
|
||||||
$theme_info[ $theme ] = $data;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( empty( $themes ) ) {
|
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>
|
<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">
|
<ul class="ul-disc">
|
||||||
<?php foreach ( $theme_info as $theme )
|
<?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>
|
</ul>
|
||||||
<p><?php _e('Are you sure you wish to delete these themes?'); ?></p>
|
<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;">
|
<form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" style="display:inline;">
|
||||||
|
|
Loading…
Reference in New Issue