From 13122b904888751519bd0b90b74ef41630f75831 Mon Sep 17 00:00:00 2001 From: scribu Date: Mon, 23 Aug 2010 21:31:42 +0000 Subject: [PATCH] Fix Recently Active plugins screen. See #14579 git-svn-id: https://develop.svn.wordpress.org/trunk@15525 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/default-list-tables.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/wp-admin/includes/default-list-tables.php b/wp-admin/includes/default-list-tables.php index c8c4570c45..0c4009939d 100644 --- a/wp-admin/includes/default-list-tables.php +++ b/wp-admin/includes/default-list-tables.php @@ -3093,8 +3093,7 @@ class WP_Plugins_Table extends WP_List_Table { 'search' => array(), 'active' => array(), 'inactive' => array(), - 'recent' => array(), - 'recently_activated' => get_option( 'recently_activated', array() ), + 'recently_activated' => array(), 'upgrade' => array(), 'mustuse' => array(), 'dropins' => array() @@ -3109,11 +3108,14 @@ class WP_Plugins_Table extends WP_List_Table { set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), 86400 ); - // Clean out any plugins which were deactivated over a week ago. - foreach ( $plugins['recently_activated'] as $key => $time ) - if ( $time + ( 7*24*60*60 ) < time() ) //1 week - unset( $plugins['recently_activated'][$key] ); - update_option( 'recently_activated', $plugins['recently_activated'] ); + $recently_activated = get_option( 'recently_activated', array() ); + + $one_week = 7*24*60*60; + foreach ( $recently_activated as $key => $time ) + if ( $time + $one_week < time() ) + unset( $recently_activated[$key] ); + update_option( 'recently_activated', $recently_activated ); + $current = get_site_transient( 'update_plugins' ); foreach ( array( 'all', 'mustuse', 'dropins' ) as $type ) { @@ -3134,7 +3136,7 @@ class WP_Plugins_Table extends WP_List_Table { $plugins['active'][ $plugin_file ] = $plugin_data; } else { if ( !is_network_admin() && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated? - $plugins['recent'][ $plugin_file ] = $plugin_data; + $plugins['recently_activated'][ $plugin_file ] = $plugin_data; $plugins['inactive'][ $plugin_file ] = $plugin_data; }