WordPress.org

Make WordPress Core

Changeset 28876


Ignore:
Timestamp:
06/28/2014 02:16:59 AM (7 years ago)
Author:
helen
Message:

Make the posts list table mode a sticky user setting. props garyc40, azaozz, ericmann. fixes #16774, #20335.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r28629 r28876  
    9999            $total_pages = $wp_query->max_num_pages;
    100100
    101         $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
     101        if ( ! empty( $_REQUEST['mode'] ) ) {
     102            $mode = $_REQUEST['mode'] == 'excerpt' ? 'excerpt' : 'list';
     103            set_user_setting ( 'posts_list_mode', $mode );
     104        } else {
     105            $mode = get_user_setting ( 'posts_list_mode', 'list' );
     106        }
    102107
    103108        $this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] == 'trash';
Note: See TracChangeset for help on using the changeset viewer.