Make WordPress Core

Changeset 26262


Ignore:
Timestamp:
11/19/2013 04:07:47 AM (11 years ago)
Author:
dd32
Message:

Plugin Deletion: Properly clear the cache when multiple plugins are deleted. Props jdgrimes. Fixes #26065

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r25880 r26262  
    804804    }
    805805
     806    // Remove deleted plugins from the plugin updates list.
     807    if ( $current = get_site_transient('update_plugins') ) {
     808        // Don't remove the plugins that weren't deleted.
     809        $deleted = array_diff( $plugins, $errors );
     810       
     811        foreach ( $deleted as $plugin_file ) {
     812            unset( $current->response[ $plugin_file ] );
     813        }
     814
     815        set_site_transient( 'update_plugins', $current );
     816    }
     817
    806818    if ( ! empty($errors) )
    807819        return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s.'), implode(', ', $errors)) );
    808 
    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     }
    814820
    815821    return true;
Note: See TracChangeset for help on using the changeset viewer.