mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 14:50:29 +00:00
First scratch at Bulk plugin upgrade from Plugins page. Props nacin for cleanups. See #11542
git-svn-id: https://develop.svn.wordpress.org/trunk@12832 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -351,21 +351,21 @@ function no_update_actions($actions) {
|
||||
}
|
||||
|
||||
function do_plugin_upgrade() {
|
||||
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
|
||||
if ( isset($_GET['plugins']) ) {
|
||||
$plugins = explode(',', $_GET['plugins']);
|
||||
} elseif ( isset($_POST['checked']) ) {
|
||||
if ( isset( $_GET['plugins'] ) ) {
|
||||
$plugins = explode( ',', $_GET['plugins'] );
|
||||
} elseif ( isset( $_POST['checked'] ) ) {
|
||||
$plugins = (array) $_POST['checked'];
|
||||
} else {
|
||||
// Nothing to do.
|
||||
return;
|
||||
}
|
||||
$url = 'update-core.php?action=do-plugin-upgrade&plugins=' . urlencode(join(',', $plugins));
|
||||
$title = __('Upgrade Plugins');
|
||||
|
||||
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
$url = 'update-core.php?action=do-plugin-upgrade&plugins=' . urlencode( implode( ',', $plugins ) );
|
||||
$title = __( 'Upgrade Plugins' );
|
||||
$nonce = 'upgrade-core';
|
||||
$upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
|
||||
$upgrader->bulk_upgrade($plugins);
|
||||
$upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url' ) ) );
|
||||
$upgrader->bulk_upgrade( $plugins );
|
||||
}
|
||||
|
||||
$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
|
||||
|
||||
Reference in New Issue
Block a user