WordPress.org

Make WordPress Core

Changeset 15527


Ignore:
Timestamp:
08/24/2010 07:50:55 PM (9 years ago)
Author:
scribu
Message:

On the plugins page, set and at the right time. See #14579

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/default-list-tables.php

    r15525 r15527  
    30623062
    30633063    function WP_Plugins_Table() {
     3064        global $status, $page;
     3065
     3066        $default_status = get_user_option( 'plugins_last_view' );
     3067        if ( empty( $default_status ) )
     3068            $default_status = 'all';
     3069        $status = isset( $_REQUEST['plugin_status'] ) ? $_REQUEST['plugin_status'] : $default_status;
     3070        if ( !in_array( $status, array( 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins', 'search' ) ) )
     3071            $status = 'all';
     3072        if ( $status != $default_status && 'search' != $status )
     3073            update_user_meta( get_current_user_id(), 'plugins_last_view', $status );
     3074
     3075        $page = $this->get_pagenum();
     3076
    30643077        parent::WP_List_Table( array(
    30653078            'screen' => 'plugins',
     
    30863099
    30873100        wp_reset_vars( array( 'orderby', 'order', 's' ) );
    3088 
    3089         $page = $this->get_pagenum();
    30903101
    30913102        $plugins = array(
  • trunk/wp-admin/plugins.php

    r15521 r15527  
    294294}
    295295
    296 $default_status = get_user_option( 'plugins_last_view' );
    297 if ( empty( $default_status ) )
    298     $default_status = 'all';
    299 $status = isset( $_REQUEST['plugin_status'] ) ? $_REQUEST['plugin_status'] : $default_status;
    300 if ( !in_array( $status, array( 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins', 'search' ) ) )
    301     $status = 'all';
    302 if ( $status != $default_status && 'search' != $status )
    303     update_user_meta( get_current_user_id(), 'plugins_last_view', $status );
    304 
    305296$wp_list_table->prepare_items();
    306297
Note: See TracChangeset for help on using the changeset viewer.