Changeset 13602 for trunk/wp-admin/update-core.php
- Timestamp:
- 03/06/2010 08:39:50 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/update-core.php
r13590 r13602 352 352 } 353 353 354 function do_plugin_upgrade() {355 if ( isset( $_GET['plugins'] ) ) {356 $plugins = explode( ',', $_GET['plugins'] );357 } elseif ( isset( $_POST['checked'] ) ) {358 $plugins = (array) $_POST['checked'];359 } else {360 // Nothing to do.361 return;362 }363 364 include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';365 $url = 'update-core.php?action=do-plugin-upgrade&plugins=' . urlencode( implode( ',', $plugins ) );366 $title = __( 'Upgrade Plugins' );367 $nonce = 'upgrade-core';368 $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url' ) ) );369 $upgrader->bulk_upgrade( $plugins );370 }371 372 354 $action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core'; 373 355 … … 387 369 } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { 388 370 check_admin_referer('upgrade-core'); 371 389 372 // do the (un)dismiss actions before headers, 390 373 // so that they can redirect … … 392 375 do_dismiss_core_update(); 393 376 elseif ( isset( $_POST['undismiss'] ) ) 394 do_undismiss_core_update(); 377 do_undismiss_core_update(); 378 395 379 require_once('admin-header.php'); 396 380 if ( 'do-core-reinstall' == $action ) … … 398 382 else 399 383 $reinstall = false; 384 400 385 if ( isset( $_POST['upgrade'] ) ) 401 386 do_core_upgrade($reinstall); 387 402 388 } elseif ( 'do-plugin-upgrade' == $action ) { 403 389 check_admin_referer('upgrade-core'); 390 391 if ( isset( $_GET['plugins'] ) ) { 392 $plugins = explode( ',', $_GET['plugins'] ); 393 } elseif ( isset( $_POST['checked'] ) ) { 394 $plugins = (array) $_POST['checked']; 395 } else { 396 wp_redirect('plugins.php'); 397 exit; 398 } 399 400 $url = 'update.php?action=update-selected&plugins=' . urlencode(implode(',', $plugins)); 401 $url = wp_nonce_url($url, 'bulk-update-plugins'); 402 403 $title = __('Update Plugins'); 404 404 405 require_once('admin-header.php'); 405 do_plugin_upgrade(); 406 echo '<div class="wrap">'; 407 screen_icon('plugins'); 408 echo '<h2>' . esc_html__('Update Plugins') . '</h2>'; 409 echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>"; 410 echo '</div>'; 406 411 } 407 412
Note: See TracChangeset
for help on using the changeset viewer.