Clean up plugins.php with regards to recently edited files, deactivations, and the network admin. see #20468, #20104.

* Limit recently_activated to the site dashboard, and properly remove bulk-activated plugins from the array.
 * Remove code used from before the network admin, such as the unused 'network' plugin_status.
 * Don't try to deactivate a plugin already deactivated.
 * Use more specific caps (manage_network_plugins) rather than is_super_admin().



git-svn-id: https://develop.svn.wordpress.org/trunk@20525 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-04-19 03:41:29 +00:00
parent 66bea4d318
commit 5ed7eb7f1c
4 changed files with 77 additions and 67 deletions

View File

@@ -65,7 +65,8 @@ case 'update':
if ( is_plugin_active($file) )
deactivate_plugins($file, true);
update_option('recently_activated', array($file => time()) + (array)get_option('recently_activated'));
if ( ! is_network_admin() )
update_option( 'recently_activated', array( $file => time() ) + (array) get_option( 'recently_activated' ) );
wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto&networkwide=" . $network_wide));
exit;