Remember last view for plugins page. see #9527

git-svn-id: http://svn.automattic.com/wordpress/trunk@11034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-21 20:38:17 +00:00
parent 35e6b4c698
commit 4e05be3860
1 changed files with 6 additions and 1 deletions

View File

@ -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;