Bulk Theme Upgrades. See #12528 See #11232 for Bulk UI

git-svn-id: https://develop.svn.wordpress.org/trunk@13686 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2010-03-13 03:59:40 +00:00
parent 8ed4a506c4
commit 34e135fa81
3 changed files with 179 additions and 22 deletions
+25 -1
View File
@@ -42,7 +42,6 @@ if ( isset($_GET['action']) ) {
$upgrader->bulk_upgrade( $plugins );
iframe_footer();
exit;
} elseif ( 'upgrade-plugin' == $action ) {
if ( ! current_user_can('update_plugins') )
@@ -163,7 +162,32 @@ if ( isset($_GET['action']) ) {
$upgrader->upgrade($theme);
include('admin-footer.php');
} elseif ( 'update-selected-themes' == $action ) {
if ( ! current_user_can( 'update_themes' ) )
wp_die( __( 'You do not have sufficient permissions to update themes for this blog.' ) );
check_admin_referer( 'bulk-update-themes' );
if ( isset( $_GET['themes'] ) )
$themes = explode( ',', stripslashes($_GET['themes']) );
elseif ( isset( $_POST['checked'] ) )
$themes = (array) $_POST['checked'];
else
$themes = array();
$themes = array_map('urldecode', $themes);
$url = 'update.php?action=update-selected-themes&themess=' . urlencode(implode(',', $themes));
$nonce = 'bulk-update-themes';
require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
wp_enqueue_script('jquery');
iframe_header();
$upgrader = new Theme_Upgrader( new Bulk_Theme_Upgrader_Skin( compact( 'nonce', 'url' ) ) );
$upgrader->bulk_upgrade( $themes );
iframe_footer();
} elseif ( 'install-theme' == $action ) {
if ( ! current_user_can('install_themes') )