From 4e05be386029a0942bda06f841755467ada21b80 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 21 Apr 2009 20:38:17 +0000 Subject: [PATCH] Remember last view for plugins page. see #9527 git-svn-id: http://svn.automattic.com/wordpress/trunk@11034 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/plugins.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index c011007032..da87cf5283 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -20,9 +20,14 @@ else $plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : ''; -$status = isset($_REQUEST['plugin_status']) ? $_REQUEST['plugin_status'] : 'all'; +$default_status = get_user_option('plugins_last_view'); +if ( empty($default_status) ) + $default_status = 'all'; +$status = isset($_REQUEST['plugin_status']) ? $_REQUEST['plugin_status'] : $default_status; if ( !in_array($status, array('all', 'active', 'inactive', 'recent', 'upgrade', 'search')) ) $status = 'all'; +if ( $status != $default_status ) + update_usermeta($current_user->ID, 'plugins_last_view', $status); $page = isset($_REQUEST['paged']) ? $_REQUEST['paged'] : 1;