mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Network Admin: Properly check if the theme is active on the main site to avoid deleting it via bulk actions.
props ocean90. fixes #29861. Built from https://develop.svn.wordpress.org/trunk@29839 git-svn-id: http://core.svn.wordpress.org/trunk@29603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b269a9c5d9
commit
53642c5d16
@ -102,24 +102,24 @@ if ( $action ) {
|
|||||||
|
|
||||||
$themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
|
$themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
|
||||||
|
|
||||||
unset( $themes[ get_option( 'stylesheet' ) ], $themes[ get_option( 'template' ) ] );
|
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$themes = array_diff( $themes, array( get_option( 'stylesheet' ), get_option( 'template' ) ) );
|
||||||
|
|
||||||
|
if ( empty( $themes ) ) {
|
||||||
|
wp_safe_redirect( add_query_arg( 'error', 'main', $referer ) );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$files_to_delete = $theme_info = array();
|
$files_to_delete = $theme_info = array();
|
||||||
foreach ( $themes as $key => $theme ) {
|
foreach ( $themes as $key => $theme ) {
|
||||||
$theme_info[ $theme ] = wp_get_theme( $theme );
|
$theme_info[ $theme ] = wp_get_theme( $theme );
|
||||||
$files_to_delete = array_merge( $files_to_delete, list_files( $theme_info[ $theme ]->get_stylesheet_directory() ) );
|
$files_to_delete = array_merge( $files_to_delete, list_files( $theme_info[ $theme ]->get_stylesheet_directory() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( empty( $themes ) ) {
|
|
||||||
wp_safe_redirect( add_query_arg( 'error', 'main', $referer ) );
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
include(ABSPATH . 'wp-admin/update.php');
|
include(ABSPATH . 'wp-admin/update.php');
|
||||||
|
|
||||||
$parent_file = 'themes.php';
|
$parent_file = 'themes.php';
|
||||||
|
Loading…
Reference in New Issue
Block a user