Make WordPress Core

Ticket #9303: 9303.patch

File 9303.patch, 937 bytes (added by hakre, 16 years ago)

managed transient

  • wp-admin/includes/plugin.php

     
    447447        $plugins_dir = trailingslashit( $plugins_dir );
    448448
    449449        $errors = array();
     450       
     451        $current = get_transient('update_plugins');
     452        $changed = false;
    450453
    451454        foreach( $plugins as $plugin_file ) {
    452455                // Run Uninstall hook
     
    462465
    463466                if ( ! $deleted )
    464467                        $errors[] = $plugin_file;
     468                else {                 
     469                        unset( $current->response[ $plugin_file ] );
     470                        $changed = true;
     471                }
    465472        }
    466473
    467474        if ( ! empty($errors) )
    468475                return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) );
    469476
    470477        // Force refresh of plugin update information
    471         delete_transient('update_plugins');
     478        if ( $changed )
     479                set_transient('update_plugins', $current);
    472480
    473481        return true;
    474482}