Make WordPress Core

Ticket #26065: 26065.diff

File 26065.diff, 1.0 KB (added by jdgrimes, 11 years ago)
  • src/wp-admin/includes/plugin.php

     
    803803                        $errors[] = $plugin_file;
    804804        }
    805805
     806        // Remove deleted plugins from the plugin updates list.
     807        if ( $current = get_site_transient('update_plugins') ) {
     808                $deleted = array_diff( $plugins, $errors ); // Don't remove the plugins that weren't deleted.
     809
     810                foreach ( $deleted as $plugin_file ) {
     811                        unset( $current->response[ $plugin_file ] );
     812                }
     813
     814                set_site_transient( 'update_plugins', $current );
     815        }
     816
    806817        if ( ! empty($errors) )
    807818                return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s.'), implode(', ', $errors)) );
    808819
    809         // Force refresh of plugin update information
    810         if ( $current = get_site_transient('update_plugins') ) {
    811                 unset( $current->response[ $plugin_file ] );
    812                 set_site_transient('update_plugins', $current);
    813         }
    814 
    815820        return true;
    816821}
    817822