Make the posts list table mode a sticky user setting. props garyc40, azaozz, ericmann. fixes #16774, #20335.
Built from https://develop.svn.wordpress.org/trunk@28876 git-svn-id: http://core.svn.wordpress.org/trunk@28675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8b3bb6cc2d
commit
81f9d12b07
|
@ -98,7 +98,12 @@ class WP_Posts_List_Table extends WP_List_Table {
|
|||
else
|
||||
$total_pages = $wp_query->max_num_pages;
|
||||
|
||||
$mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
|
||||
if ( ! empty( $_REQUEST['mode'] ) ) {
|
||||
$mode = $_REQUEST['mode'] == 'excerpt' ? 'excerpt' : 'list';
|
||||
set_user_setting ( 'posts_list_mode', $mode );
|
||||
} else {
|
||||
$mode = get_user_setting ( 'posts_list_mode', 'list' );
|
||||
}
|
||||
|
||||
$this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] == 'trash';
|
||||
|
||||
|
|
Loading…
Reference in New Issue