From 435b3a017767ca1c1b762af88f974bc7cfb34402 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 3 Oct 2011 14:35:43 +0000 Subject: [PATCH] Implement bulk update for network/themes.php. Props ocean90. fixes #18687 git-svn-id: http://svn.automattic.com/wordpress/trunk@18869 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/network/themes.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/wp-admin/network/themes.php b/wp-admin/network/themes.php index e5a5b9fd6..96f6138a8 100644 --- a/wp-admin/network/themes.php +++ b/wp-admin/network/themes.php @@ -76,6 +76,34 @@ if ( $action ) { wp_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) ); exit; break; + case 'update-selected' : + check_admin_referer( 'bulk-themes' ); + + if ( isset( $_GET['themes'] ) ) + $themes = explode( ',', $_GET['themes'] ); + elseif ( isset( $_POST['checked'] ) ) + $themes = (array) $_POST['checked']; + else + $themes = array(); + + $title = __( 'Update Themes' ); + $parent_file = 'themes.php'; + + require_once(ABSPATH . 'wp-admin/admin-header.php'); + + echo '
'; + screen_icon(); + echo '

' . esc_html( $title ) . '

'; + + + $url = self_admin_url('update.php?action=update-selected-themes&themes=' . urlencode( join(',', $themes) )); + $url = wp_nonce_url($url, 'bulk-update-themes'); + + echo ""; + echo '
'; + require_once(ABSPATH . 'wp-admin/admin-footer.php'); + exit; + break; case 'delete-selected': if ( ! current_user_can( 'delete_themes' ) ) wp_die( __('You do not have sufficient permissions to delete themes for this site.') );