WordPress.org

Make WordPress Core

Changeset 11034


Ignore:
Timestamp:
04/21/09 20:38:17 (5 years ago)
Author:
ryan
Message:

Remember last view for plugins page. see #9527

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugins.php

    r11029 r11034  
    2121$plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : ''; 
    2222 
    23 $status = isset($_REQUEST['plugin_status']) ? $_REQUEST['plugin_status'] : 'all'; 
     23$default_status = get_user_option('plugins_last_view'); 
     24if ( empty($default_status) ) 
     25    $default_status = 'all'; 
     26$status = isset($_REQUEST['plugin_status']) ? $_REQUEST['plugin_status'] : $default_status; 
    2427if ( !in_array($status, array('all', 'active', 'inactive', 'recent', 'upgrade', 'search')) ) 
    2528    $status = 'all'; 
     29if ( $status != $default_status ) 
     30    update_usermeta($current_user->ID, 'plugins_last_view', $status); 
    2631 
    2732$page = isset($_REQUEST['paged']) ? $_REQUEST['paged'] : 1; 
Note: See TracChangeset for help on using the changeset viewer.