mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Plugin bulk upgrade rough in. see #10973
git-svn-id: https://develop.svn.wordpress.org/trunk@12097 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -285,16 +285,25 @@ function do_undismiss_core_update() {
|
||||
wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );
|
||||
}
|
||||
|
||||
function no_update_actions($actions) {
|
||||
return '';
|
||||
}
|
||||
|
||||
function do_plugin_upgrade() {
|
||||
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
|
||||
$plugins = (array) $_POST['checked'];
|
||||
$url = 'update-core.php';
|
||||
|
||||
foreach ( $plugins as $plugin ) {
|
||||
$upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
|
||||
$upgrader->upgrade($plugin);
|
||||
if ( isset($_GET['plugins']) ) {
|
||||
$plugins = explode(',', $_GET['plugins']);
|
||||
} else {
|
||||
$plugins = (array) $_POST['checked'];
|
||||
}
|
||||
$url = 'update-core.php?action=do-plugin-upgrade&plugins=' . urlencode(join(',', $plugins));
|
||||
$title = __('Upgrade Plugins');
|
||||
$nonce = 'upgrade-core';
|
||||
add_filter('update_plugin_complete_actions', 'no_update_actions');
|
||||
|
||||
$upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
|
||||
$upgrader->bulk_upgrade($plugins);
|
||||
}
|
||||
|
||||
$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
|
||||
|
||||
Reference in New Issue
Block a user