Network Admin: Remove the list of files which will be deleted when deleting a theme.
Fixes #34439. Built from https://develop.svn.wordpress.org/trunk@35996 git-svn-id: http://core.svn.wordpress.org/trunk@35961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
740d197731
commit
51bb4db622
|
@ -116,27 +116,10 @@ if ( $action ) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$files_to_delete = $theme_info = array();
|
||||
$theme_info = array();
|
||||
$theme_translations = wp_get_installed_translations( 'themes' );
|
||||
foreach ( $themes as $key => $theme ) {
|
||||
$theme_info[ $theme ] = wp_get_theme( $theme );
|
||||
|
||||
// Locate all the files in that folder.
|
||||
$files = list_files( $theme_info[ $theme ]->get_stylesheet_directory() );
|
||||
if ( $files ) {
|
||||
$files_to_delete = array_merge( $files_to_delete, $files );
|
||||
}
|
||||
|
||||
// Add translation files.
|
||||
$theme_slug = $theme_info[ $theme ]->get_stylesheet();
|
||||
if ( ! empty( $theme_translations[ $theme_slug ] ) ) {
|
||||
$translations = $theme_translations[ $theme_slug ];
|
||||
|
||||
foreach ( $translations as $translation => $data ) {
|
||||
$files_to_delete[] = $theme_slug . '-' . $translation . '.po';
|
||||
$files_to_delete[] = $theme_slug . '-' . $translation . '.mo';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
include(ABSPATH . 'wp-admin/update.php');
|
||||
|
@ -194,17 +177,6 @@ if ( $action ) {
|
|||
<form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;">
|
||||
<?php submit_button( __( 'No, return me to the theme list' ), 'button', 'submit', false ); ?>
|
||||
</form>
|
||||
|
||||
<p><a href="#" onclick="jQuery('#files-list').toggle(); return false;"><?php _e('Click to view entire list of files which will be deleted'); ?></a></p>
|
||||
<div id="files-list" style="display:none;">
|
||||
<ul class="code">
|
||||
<?php
|
||||
foreach ( (array) $files_to_delete as $file ) {
|
||||
echo '<li>' . esc_html( str_replace( WP_CONTENT_DIR . '/themes', '', $file ) ) . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once(ABSPATH . 'wp-admin/admin-footer.php');
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.5-alpha-35995';
|
||||
$wp_version = '4.5-alpha-35996';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue