From 7b00e4b1564d9e9df525050fa0d32375e1165bdd Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 29 Sep 2012 01:36:14 +0000 Subject: [PATCH] Fix Bulk Theme Deletion in the Network Admin when using FTP. Props kobenland. Fixes #20671 git-svn-id: https://develop.svn.wordpress.org/trunk@22084 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/network/themes.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/wp-admin/network/themes.php b/wp-admin/network/themes.php index 99de584928..04840ee110 100644 --- a/wp-admin/network/themes.php +++ b/wp-admin/network/themes.php @@ -176,10 +176,21 @@ if ( $action ) { exit; } // Endif verify-delete - foreach ( $themes as $theme ) - $delete_result = delete_theme( $theme, esc_url( add_query_arg( array('verify-delete' => 1), $_SERVER['REQUEST_URI'] ) ) ); + foreach ( $themes as $theme ) { + $delete_result = delete_theme( $theme, esc_url( add_query_arg( array( + 'verify-delete' => 1, + 'action' => 'delete-selected', + 'checked' => $_REQUEST['checked'], + '_wpnonce' => $_REQUEST['_wpnonce'] + ), network_admin_url( 'themes.php' ) ) ) ); + } + $paged = ( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1; - wp_redirect( network_admin_url( "themes.php?deleted=".count( $themes )."&paged=$paged&s=$s" ) ); + wp_redirect( add_query_arg( array( + 'deleted' => count( $themes ), + 'paged' => $paged, + 's' => $s + ), network_admin_url( 'themes.php' ) ) ); exit; break; }