diff --git a/wp-admin/includes/class-wp-plugins-list-table.php b/wp-admin/includes/class-wp-plugins-list-table.php
index 7c9bb68a10..38b09e3c8c 100644
--- a/wp-admin/includes/class-wp-plugins-list-table.php
+++ b/wp-admin/includes/class-wp-plugins-list-table.php
@@ -129,12 +129,21 @@ class WP_Plugins_List_Table extends WP_List_Table {
set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS );
- if ( ! $screen->in_admin( 'network' ) ) {
+ if ( $screen->in_admin( 'network' ) ) {
+ $recently_activated = get_site_option( 'recently_activated', array() );
+ } else {
$recently_activated = get_option( 'recently_activated', array() );
+ }
- foreach ( $recently_activated as $key => $time )
- if ( $time + WEEK_IN_SECONDS < time() )
- unset( $recently_activated[$key] );
+ foreach ( $recently_activated as $key => $time ) {
+ if ( $time + WEEK_IN_SECONDS < time() ) {
+ unset( $recently_activated[$key] );
+ }
+ }
+
+ if ( $screen->in_admin( 'network' ) ) {
+ update_site_option( 'recently_activated', $recently_activated );
+ } else {
update_option( 'recently_activated', $recently_activated );
}
@@ -170,8 +179,8 @@ class WP_Plugins_List_Table extends WP_List_Table {
// On the network-admin screen, populate the active list with plugins that are network activated
$plugins['active'][ $plugin_file ] = $plugin_data;
} else {
- if ( ! $screen->in_admin( 'network' ) && isset( $recently_activated[ $plugin_file ] ) ) {
- // On the non-network screen, populate the recently activated list with plugins that have been recently activated
+ if ( isset( $recently_activated[ $plugin_file ] ) ) {
+ // Populate the recently activated list with plugins that have been recently activated
$plugins['recently_activated'][ $plugin_file ] = $plugin_data;
}
// Populate the inactive list with plugins that aren't activated
@@ -400,7 +409,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
echo '
';
- if ( ! $this->screen->in_admin( 'network' ) && 'recently_activated' === $status ) {
+ if ( 'recently_activated' == $status ) {
submit_button( __( 'Clear List' ), 'button', 'clear-recent-list', false );
} elseif ( 'top' === $which && 'mustuse' === $status ) {
echo '
' . sprintf( __( 'Files in the %s directory are executed automatically.' ), str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) ) . '
';
diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php
index 96bface13f..f347da93b5 100644
--- a/wp-admin/plugin-editor.php
+++ b/wp-admin/plugin-editor.php
@@ -71,8 +71,11 @@ case 'update':
if ( is_plugin_active($file) )
deactivate_plugins($file, true);
- if ( ! is_network_admin() )
+ if ( ! is_network_admin() ) {
update_option( 'recently_activated', array( $file => time() ) + (array) get_option( 'recently_activated' ) );
+ } else {
+ update_site_option( 'recently_activated', array( $file => time() ) + (array) get_site_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;
diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php
index 32bf7dc586..57bad92a6d 100644
--- a/wp-admin/plugins.php
+++ b/wp-admin/plugins.php
@@ -54,6 +54,10 @@ if ( $action ) {
$recent = (array) get_option( 'recently_activated' );
unset( $recent[ $plugin ] );
update_option( 'recently_activated', $recent );
+ } else {
+ $recent = (array) get_site_option( 'recently_activated' );
+ unset( $recent[ $plugin ] );
+ update_site_option( 'recently_activated', $recent );
}
if ( isset($_GET['from']) && 'import' == $_GET['from'] ) {
@@ -96,9 +100,18 @@ if ( $action ) {
if ( ! is_network_admin() ) {
$recent = (array) get_option('recently_activated' );
- foreach ( $plugins as $plugin )
- unset( $recent[ $plugin ] );
+ } else {
+ $recent = (array) get_site_option('recently_activated' );
+ }
+
+ foreach ( $plugins as $plugin ) {
+ unset( $recent[ $plugin ] );
+ }
+
+ if ( ! is_network_admin() ) {
update_option( 'recently_activated', $recent );
+ } else {
+ update_site_option( 'recently_activated', $recent );
}
wp_redirect( self_admin_url("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s") );
@@ -165,8 +178,13 @@ if ( $action ) {
}
deactivate_plugins( $plugin, false, is_network_admin() );
- if ( ! is_network_admin() )
+
+ if ( ! is_network_admin() ) {
update_option( 'recently_activated', array( $plugin => time() ) + (array) get_option( 'recently_activated' ) );
+ } else {
+ update_site_option( 'recently_activated', array( $plugin => time() ) + (array) get_site_option( 'recently_activated' ) );
+ }
+
if ( headers_sent() )
echo "
";
else
@@ -194,11 +212,15 @@ if ( $action ) {
deactivate_plugins( $plugins, false, is_network_admin() );
+ $deactivated = array();
+ foreach ( $plugins as $plugin ) {
+ $deactivated[ $plugin ] = time();
+ }
+
if ( ! is_network_admin() ) {
- $deactivated = array();
- foreach ( $plugins as $plugin )
- $deactivated[ $plugin ] = time();
update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) );
+ } else {
+ update_site_option( 'recently_activated', $deactivated + (array) get_site_option( 'recently_activated' ) );
}
wp_redirect( self_admin_url("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s") );
@@ -354,8 +376,11 @@ if ( $action ) {
exit;
case 'clear-recent-list':
- if ( ! is_network_admin() )
+ if ( ! is_network_admin() ) {
update_option( 'recently_activated', array() );
+ } else {
+ update_site_option( 'recently_activated', array() );
+ }
break;
}
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 8b919e6478..eeba707044 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
-$wp_version = '4.4-alpha-34550';
+$wp_version = '4.4-alpha-34551';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.