mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Delete plugin confirmation from DD32. see #7091
git-svn-id: https://develop.svn.wordpress.org/trunk@8095 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -136,7 +136,6 @@ function deactivate_plugins($plugins, $silent= false) {
|
||||
update_option('active_plugins', $current);
|
||||
}
|
||||
|
||||
//Replaces reactivate_all_plugins() / deactivate_all_plugins() = 'deactivated_plugins' is now useless
|
||||
function activate_plugins($plugins, $redirect = '') {
|
||||
if ( !is_array($plugins) )
|
||||
$plugins = array($plugins);
|
||||
@@ -167,7 +166,7 @@ function delete_plugins($plugins, $redirect = '' ) {
|
||||
$checked[] = 'checked[]=' . $plugin;
|
||||
|
||||
ob_start();
|
||||
$url = wp_nonce_url('plugins.php?action=delete-selected&' . implode('&', $checked), 'mass-manage-plugins');
|
||||
$url = wp_nonce_url('plugins.php?action=delete-selected&verify-delete=1&' . implode('&', $checked), 'bulk-manage-plugins');
|
||||
if ( false === ($credentials = request_filesystem_credentials($url)) ) {
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
@@ -243,13 +242,9 @@ function validate_active_plugins() {
|
||||
// If a plugin file does not exist, remove it from the list of active
|
||||
// plugins.
|
||||
foreach ( $check_plugins as $check_plugin ) {
|
||||
if ( !file_exists(WP_PLUGIN_DIR . '/' . $check_plugin) ) {
|
||||
$current = get_option('active_plugins');
|
||||
$key = array_search($check_plugin, $current);
|
||||
if ( false !== $key && NULL !== $key ) {
|
||||
unset($current[$key]);
|
||||
update_option('active_plugins', $current);
|
||||
}
|
||||
$result = validate_plugin($check_plugin);
|
||||
if ( is_wp_error( $result ) ) {
|
||||
deactivate_plugins( $check_plugin, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user